Jump to content

Archived

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

glenelkins

JavaScript and PHP Form Validation Question

Recommended Posts

Hi

Ok 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

Share this post


Link to post
Share on other sites
So is noone going to help me with this?

Share this post


Link to post
Share on other sites

×

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.