September 12th, 2013, 05:59 PM
Domain extension validation
This is the current validation i have to make sure the input is not empty
How can i add this validation to my code?
if (x==null || x=="")
alert("Please Enter a domain with relevant extension");
I only want to allow .com | .net | .org domains without the www or http://
so if they type www.domainname.com it will show a pop up error
if they type domainname.de (or any other extension to the ones i want to allow) it will show a pop up error.
Hyphens and digits should be allowed before the extension.
September 12th, 2013, 07:42 PM
Welcome to DevShed Forums, rugmonster.
Would you mind explaining why you want to restrict them to just those three TLDs (top level domains)?
Why show an error? Wouldn't it be more user-friendly to just silently remove the "www." when the form is submitted?
September 12th, 2013, 08:12 PM
Thank you for the welcome message
Basically i am trying to create a user admin panel where people can add their domain names to their portfolio however at this moment in time i only want to display these extension domains, and i like the idea about silently removing the www etc. could you please point me in the right direction