0

Hi I am doing simple form registration validation using jquery. Only thing is i have used boot strap framework.

When I click on registration button noting will happen;

In fire bug console it display

[09:35:37.239] Empty string passed to getElementById(). @ http://www.matrimonyteam.com/home/registration

For more information you go thru this url http://www.matrimonyteam.com/home/registration

function register(){

    var validator = $("#profileRegistrationForm").validate({
        rules: {                            
            firstName: "required",
            lastName: "required",
            email: "required",
            loginPassword: "required",
            mobileNumber: "required",       
            gender: "required",
            birthDate: "required",
            motherTongue: "required"
        },
        errorElement: "span",                               
            messages: {
            firstName: "Enter First Name",
            lastName: "Enter Last Name",
            email: "Enter Valid Email Address",
            loginPassword: "Enter Password",
            mobileNumber: "Enter Mobile Number",        
            gender: "Select Your Gender",
            birthDate: "Select Birth Date",
            motherTongue: "Select Mother Tongue"
            }
    });
    if(validator.form()){ 
         $('form#profileRegistrationForm').attr({action: '/home/saveprofile'});         
         $('form#profileRegistrationForm').submit();
    }   
}

Click event is registered

 <script type="text/javascript"> 
    $(document).ready(function () {

        $('#register').click(function() {       
            register();
        });     
    </script> 
madth3
  • 7,275
  • 12
  • 50
  • 74
Vicky
  • 9,515
  • 16
  • 71
  • 88
  • 1
    I'm seeing other errors prior... http://screencast.com/t/XkwThGbcnio1 – Seth McClaine Jul 16 '13 at 04:16
  • @SethMcClaine , added addition check $.browser && $.browser.msie in jquery validation .. but ideally i should not touch the core lib... now its working thanks – Vicky Jul 16 '13 at 04:25

1 Answers1

1

I think you are using newer version of jquery, after jquery 1.9 $.browser has removed.

You can download the latest version (Current version: 1.11.1) of validate plugin to solve the problem. Or you can use CDN

http://ajax.aspnetcdn.com/ajax/jquery.validate/1.11.1/jquery.validate.js

or download it from http://bassistance.de/jquery-plugins/jquery-plugin-validation

Read jQuery.browser() removed and jQuery Core 1.9 Upgrade Guide.

Also read this

Community
  • 1
  • 1
Rohan Kumar
  • 40,431
  • 11
  • 76
  • 106