hi!, how will I validate a form input that will only accept a domain name only. example: http://www.UserSubmittedSite.com http://www.UserSubmittedSite.org http://www.UserSubmittedSite.info Thanks in adavance!
Thank you very for the fast reply but the script dont work if i use a post method EDIT: Its working now Thank You very much! <form name="form1" onSubmit="return checkDomain(form1.Link.value)" method="post" action="process.php"> Link <input name="Link" type="text" id="Link2"> <input type="submit" name="Submit" value="Add"> <img src="CaptchaSecurityImages.php" /> Security Code: <input id="security_code" name="security_code" type="text" /> </form> Code (markup):
javascript is a client side script. therefore the validaiton is done on the users browser. This should never be trusted, perform additional user input validation in php, get the regex for a domain name from here http://regexlib.com/ and do an ereg in php.