By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,276 Members | 2,137 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,276 IT Pros & Developers. It's quick & easy.

advanced form validation

P: n/a
I am trying to find some tutorials on advanced form validation.
I have a form and I have basic validation (empty, value, etc) but I
would like to validate some forms to stop people from using the form
to spam me or others.
I would like to restrict the value of the email field to just 1 email
value and to not allow urls to be input in the comments or other text
areas.
I have the following:

if (document.form.fullname.value== "http://" )
{
alert("This form will not serve as email relay for spamming
purposes. Enter a real name!");
document.form.fullname.select();
document.form.fullname.focus();
return false;
}

But that only checks if the value *is* http://.....I wanted to
validate for values that *contain* http://.....
As for the email field I validate for values that *don't have* @ or .
but I don't know how to validate to stop the input of more than 1 @...

Can anybody give me a hand on this one?

Thank you in advance,

FayeC
Jun 3 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
FayeC wrote:
I am trying to find some tutorials on advanced form validation.
I have a form and I have basic validation (empty, value, etc) but I
would like to validate some forms to stop people from using the form
to spam me or others.


You should do this on the server side, consider the user who disables
JavaScript, or access your site through scripts.
--
Ian Collins.
Jun 3 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.