jquery form validation plugin need help?

Posted by python on Stack Overflow See other posts from Stack Overflow or by python
Published on 2010-03-08T02:00:02Z Indexed on 2010/03/08 2:12 UTC
Read the original article Hit count: 691

Filed under:
    </tr>
for ($i = 0; $i < $dm_numrec; $i++) {
?>
         <tr>
           <td width="266" height="28" valign="top">
             <input type="text" name="recommend_to_name<?php echo $i;?>" />
           </td>
           <td height="28" valign="top">
             <input type="text" name="recommend_to_email<?php echo $i;?> />" 
           </td>
         </tr>

I used jquery form validation plugin http://bassistance.de/jquery-plugins/jquery-plugin-validation/

<script src="jquery.min.js"></script>

<script src="jquery.validate.min.js"></script>

        <script>
            $(document).ready(function(){           
                $('#recommend').validate({
                    'rules':{
                        'recommend_to_name':'required',
                        'recommend_to_email':{
                            'required':true,
                            'email':true
                        },              
                    }
                });

            });

        </script>   

How can I validate for the recommend_to_name that its name is a dynamic string from loop:

recommend_to_name0

recommend_to_name1

recommend_to_name2

recommend_to_name..

© Stack Overflow or respective owner

Related posts about jQuery