Jump to content

javascript alert message


verN

Recommended Posts

This is an edit form where users can update the email addresses. I had the following working when a user removed an email address and then clicked on submit and if an email address wasn't added a message would appear. However, i have now made the email address an array and the following code does not work.

 

Thanks in advance p.s email[] is an array

 

 

<script language="Javascript" type="text/javascript">

function checkEmail() 
{    
    for (i = 0; i < email.length; i++) {
    if(document.form2.email[i].value=='') {
	alert('Please input a valid email address!');
	return false;

	} else {
	return true;
}
}
}     
</script> 

 

Basically this is part of the update form where the user can make any chnages to an email address, they cannot completely remove an email address that's where this message appears

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.