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
https://forums.phpfreaks.com/topic/43110-javascript-alert-message/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.