dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: [RESOLVED] Name to ID

  1. #1
    Join Date
    Sep 2010
    Posts
    3

    resolved [RESOLVED] Name to ID

    Hi,

    this is my script:

    HTML Code:
         <form id="frm1"><fieldset>
                    <ul>
                        <li>
                            <label for="name">Name:</label>
                            <input type="text" name="name" />
                        </li>
                        <li>
                            <label for="email">Email:</label>
                            <input type="text" name="email" />  
                        </li>
                         <li>
                            <label for="one">one:</label>
                            <input type="text" name="one" />  
                        </li>
                            <div id="results"><div>
                        <li>
                            <input type="submit" value="submit" />         
                        </li>
                    </ul>
               </fieldset>
            </form> 
    
        jQuery(document).ready(function($){
            $("#frm1").validate({
                debug: false,
                rules: {
                    name: "required",
                    email: {
                        required: true,
                        email: true
                    }
                },
                messages: {
                    name: "Please let us know who you are.",
                    email: "A valid email will help us get in touch with you.",
                },
                
    
            });
        });
    The script works fine, but I would like to change something.

    I would like this:
    <input type="text" name="name" />

    to change into this:
    <input type="text" id="name" />

    But when I do this, the validation script does not work.
    Is there a way to change this?

    Thank you!

  2. #2
    Join Date
    Feb 2012
    Posts
    12
    keep the name="name" and add the id="name as well. Is their a reason why you want to add a ID?

  3. #3
    Join Date
    Sep 2010
    Posts
    3
    Thank you.

    I would like the name parameter to use for an other plugin.
    The other plugin, uses names like: "formandler[one]", and the jQuery script wont accept the [].

    Thank you for your post!

    I think I just solved my problem.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles