I was given this code to replace my "table" in my Contact Form: <fieldset class="info"> <label for="info_name"><span>*</span>Your Name</label> <input type="text" name="name" id="info_name" maxlength="50" /> <br /> <label for="info_email"><span>*</span>Email Address</label> <input type="text" name="email" id="info_email" maxlength="40" /> <br /> <label for="info_subject">Subject:</label> <input type="text" name="subject" id="info_subject" maxlength="40" /> <br /> <label for="info_comments">Comments:</label> <textarea name="comments" id="info_comments"></textarea> </fieldset> <fieldset class="captcha"> <label for="captcha_text"><span>*</span>Enter Image Code:</label> <input type="text" value="" name="captext" id="captcha_text" maxlength="6" /> <a href="#" onclick="refresh_security_image(); return false;">Refresh Image</a> <img src="includes/captcha.php" id="verificiation_image" /> </fieldset> <fieldset class="submitsAndHiddens"> <input type="submit" value="Submit" /> </fieldset> Code (markup): I just don't know how to integrate it with this existing page code: <body> <!--<div style="height: 80px; background-color: #336699;"> <span class="page_title"><span class="form_title">Contact Us</span></span> </div>--> <br /> <table cellpadding="0" cellspacing="0" align="center" width="600"> <tr> <td> <font face="verdana"><font size="2"><font color=#800000;">[var.result]</font></font><font color="red"><strong>[var.error]</strong></font><br> <hr size="1" /> <br /> <form action="/page.php?page=10" method="post" name="contact_us" onSubmit="return capCheck(this);"> <table cellpadding="5" width="100%"> <tr> <td width="10" class="required_field">*</td> <td width="80">Your Name</td> <td> <input type="text" name="name" maxlength="50" style="width:300px" /></td> </tr> <tr> <td class="required_field">*</td> <td>Email Address</td> <td> <input type="text" name="email" maxlength="40" style="width:300px" /></td> </tr> <tr> <td></td> <td>Subject:</td> <td> <input type="text" name="subject" maxlength="40" style="width:300px" /></td> </tr> <tr> <td></td> <td>Comments:</td> <td> <textarea name="comments" style="width: 100%; height: 250px"></textarea></td> </tr> <tr> <td class="required_field">*</td> <td>Enter Image Code:</td> <td> <input type="text" value="" name="captext" style="width: 100px" maxlength="6" /></td> </tr> <tr> <td></td> <td><a onclick="refresh_security_image(); return false;" style="cursor:pointer;"><u>Refresh Image</u></a></td> <td> <img src="includes/captcha.php" border="0" id="verificiation_image" /></a></td> </tr> </table> <br/> <br/> <p> <input type="hidden" name="submited" value="1" /> <input type="submit" name="submit" value="Submit" /> </p> </form> </td> </tr> </table> <script type="text/javascript"> <!-- function refresh_security_image() { var new_url = new String("[var.base_url]/includes/captcha.php?width=132&height=36&charcators="); new_url = new_url.substr(0, new_url.indexOf("width=") + 37); // we need a random new url so this refreshes var chr_str = "123456789"; for(var i=0; i < 6; i++) new_url = new_url + chr_str.substr(Math.floor(Math.random() * 2), 1); document.getElementById("verificiation_image").src = new_url; } --> </script> <!-- captch start --> <script type="text/javascript" id="clientEventHandlersJS" language="javascript"> <!-- function capCheck(theForm) { var xmlhttp; var sReply; DataToSend = "action=process&captext=" + escape(theForm.captext.value); if (window.XMLHttpRequest) { xmlhttp=new XMLHttpRequest(); xmlhttp.open("POST",'includes/process.php',false); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlhttp.send(DataToSend); sReply = xmlhttp.responseText; } else if (window.ActiveXObject) { xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); xmlhttp.open("POST",'includes/process.php',false); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); xmlhttp.send(DataToSend); sReply = xmlhttp.responseText; } if (sReply == "good") { return true; } else if (sReply == "bad") { alert("Security code not valid, please try again"); return false; } else if (sReply == "") { alert("You must enter the security code"); return false; } else { alert("Error"); return false; } } --> </script> <!-- captch end --> </body> Code (markup): Can you help me? Thanks
Thanks for your reply, however there's no page to see. Just hoping to get some help integrating this code together.