glenelkins Posted May 29, 2006 Share Posted May 29, 2006 HiOk so i create 15 email fields in the following way (PHP):[code]for ($i=1;$i<15;$i++) { ?> <tr> <td> <input type="text" name="email[]"> </td> </tr> <?}?>[/code]Then when the form is submitted it uses javascript onClick to run a validation function (JavaScript):[code]if(document.frmDetails.recemail.value==""){ blnValid=false; strAlert+="The receipient's email address\n";}[/code]This function was written when there was only a single email field, how do i write the code to loop through each of the email text fields in the array??Cheers Quote Link to comment https://forums.phpfreaks.com/topic/10694-javascript-and-php-form-validation-question/ Share on other sites More sharing options...
glenelkins Posted May 29, 2006 Author Share Posted May 29, 2006 So is noone going to help me with this? Quote Link to comment https://forums.phpfreaks.com/topic/10694-javascript-and-php-form-validation-question/#findComment-39965 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.