Forum Moderators: open

Message Too Old, No Replies

Verifying an email address in a submission form.

Is this possible on a regular form mail?

         

theadvocate

12:54 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



Hello,

I need to set it up to verify the email address is the same in two different fields on a regular HTML form mail.

For example, there is email field one, then email field two. They should enter the same email in both to verify they have typed it correctly.

Is there a fairly simple command for this?

Thanks!

[edited by: theadvocate at 1:32 pm (utc) on Feb. 10, 2004]

ukgimp

1:06 pm on Feb 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



[javascript.internet.com...]

Does this help.

theadvocate

1:30 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



Thanks ukgimp, but I was looking for something a little simpler.

The following is what I use for making sure they fill out the email field. I know it may be a bit more involved to verify they put the same email into two fields twice, but the example you sent is about a page's worth of script.

<script language=javascript>
<!--
function openwindow(test) {
window.open(test, 'test', 'toolbar=no,scrollbars=2,location=no,status=no,menubar=no,resizable');
}

function validate(form)
{
//Data validation using object names to reference objects

if (form.contactname.value == "")
{
alert("You must enter your name!");
form.contactname.focus()
return false;
}

if (form.contact2.value == "")
{
alert("You must enter your email!");
form.contact2.focus()
return false;
}
}

// -->
</script>

incywincy

1:32 pm on Feb 10, 2004 (gmt 0)

10+ Year Member



maybe do a google on javascript email regular expressions