Jump to content

Email form issue. Not enforcing it.


tim_ver

Recommended Posts

I have this script now for one of my forms and when people use it they are putting in n/a or bobo.bob.com for email address so when I get the form I get in the from spot the hositing companies email and not the users name or email, how do I fix this so they must use a valid email format, and it puts what the use in the email line in the from spot?

 

Code:

<script type="text/javascript" language="javascript" charset="utf-8">

// <![CDATA[

function Check()

{

error = '';

if(document.frm.Email.value=='') { error += 'Email is required\n'; }

if(document.frm.Contact_Name.value=='') { error += 'Contact name is required\n'; }

if(document.frm.Contact_Phone.value=='') { error += 'Phone number is required\n'; }

 

if(error!=''){ window.alert(error); return false; }

return true;

}

// ]]>

</script>

 

 

Thanks

Link to comment
Share on other sites

I did add this to it but not working. I need it to force users to enter a vaild email address in the email box.

 

<script type="text/javascript" language="javascript" charset="utf-8">

// <![CDATA[

{

error = '';

function Check()

function validate_Email(field,alerttxt)

{

with (field)

{

apos=value.indexOf("@")

dotpos=value.lastIndexOf(".")

if (apos<1||dotpos-apos<2)

  {alert(alerttxt);return false}

else {return true}

if(document.frm.Email.value=='') { error += 'Email is required\n'; }

if(document.frm.Contact_Name.value=='') { error += 'Contact name is required\n'; }

if(document.frm.Contact_Phone.value=='') { error += 'Phone number is required\n'; }

 

if(error!=''){ window.alert(error); return false; }

return true;

}

// ]]>

</script>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.