Can someone give me specific JavaScript code to check if the field Affiliatecode has the characters "http://" in it in the form code below? I can't understand how to validate this label and input name stuff... Please provide the head code too... I'm a newbie. Thanks... <form method="post" action="http://oi.vresp.com?fid=aa7d65ed2a" target="vr_optin_popup" onsubmit="window.open( 'http://www.verticalresponse.com', 'vr_optin_popup', 'scrollbars=yes,width=600,height=450' ); return true;" > <div style="font-family: verdana; font-size: 11px; width: 160px; padding: 10px; border: 1px solid #000000; background: #dddddd;"> <strong><span style="color: #333333;">Sign Up Today!</span></strong> <p style="text-align: right; margin-top: 10px; margin-bottom: 10px;"><span style="color: #f00;">* </span><span style="color: #333333">required</span></p> <label style="color: #333333;">Email Address:</label> <span style="color: #f00">* </span> <br/> <input name="email_address" size="15" style="margin-top: 5px; margin-bottom: 5px; border: 1px solid #999; padding: 3px;"/> <br/> <label style="color: #333333;">Affiliate Code:</label> <br/> <input name="Affiliatecode" size="15" style="margin-top: 5px; margin-bottom: 5px; border: 1px solid #999; padding: 3px;"/> <br/> <input type="submit" value="Join Now" style="margin-top: 5px; border: 1px solid #999; padding: 3px;"/><br/> <br/><span style="color: #333333"><a href="http://www.verticalresponse.com" title="Email Marketing by VerticalResponse">Email Marketing</a> by VerticalResponse</span> </div> </form>
use this function function isUrl(s) { var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/ return regexp.test(s); } Code (markup):