Hello,
I have a page which is a form for people to fill in. There is one input
line where the user enters in an e-mail address. Currently the page is
using java to verify that e-mail address. It looks like the java code
is only checking for an "@" side, but I want it to also check for a "."
and the end of the domain type. Somebody else wrote this code for me,
and I don't know anything about java. Could somebody show me what I
need to do to change this java code to PHP? If that is even possible?
And, to do the additional verify that I would like to do on the e-mail
address.
Here is the code:
function validate(){
form = document.subscribe;
if ( form.email.value == ""){
alert("Please enter your email address in the \"Email Address\" and
\"Verify Email Address\" boxes");
form.email.focus();
return false;
}
else {
if ( form.email.value != form.vemail.value ){
alert("Please verify you have entered the correct email address in
the \"Email Address\" and \"Verify Email Address\" boxes");
form.email.focus();
return false;
}
}
if( form.email.length != 0)
{
txt = form.email.value;
if (txt.indexOf("@")<3)
{
alert("This email address seems wrong. Please check the prefix and
\"@\" sign.");
form.email.focus();
return false;
}
}
if( form.vemail.length != 0)
{
txt = form.vemail.value;
if (txt.indexOf("@")<3)
{
alert("This email address seems wrong. Please check the prefix and
\"@\" sign.");
form.vemail.focus();
return false;
}
}
}
Thanks,
Jeff
--
Jeff Grossman ([EMAIL PROTECTED])
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]