button wont work on IE after updating validation code
Hi,
After adding some lines of validation from Jorn's validate plugin,
the addcar button on IE suddenly won't work,
then safari is working, but not displaying updating properly after the animation, it will appear as if broken, but if you scroll up scroll down, then it would update
Chrome and firefox is okay.
Here is the button click code
- $('#addvehicle').bind('click',function()
- {
- //ajax
- $.ajax
- ({
- type: "POST",
- url: "addmorecar",
- data: "sessionid=" + $("#sessionid").val(),
- success: function(data)
- {
- $("#regaddcar").html(data).addClass('ui-widget ui-widget-content');
- $("#regaddcar").fadeIn();
- $("#addvehicle").attr('disabled','disabled').css('color','#CCCCCC');
- }
- });
- return false;
- }); // end of the on click add vehicle function
Here is the validation code
- $('#reg_addcar').validate
- ({
- rules:
- {
- regaddress:
- {
- minlength: 10
- },
- platenum:
- {
- remote:
- {
- url: "gplatechecker",
- type: "post"
- }
- },
- chassisnum:
- {
- rangelength: [10,17]
- },
- mvfnum1:
- {
- minlength: 4
- },
- mvfnum2:
- {
- rangelength: [6,12]
- }
- },
- messages:
- {
- regaddress:
- {
- minlength: 'Enter a proper address'
- },
- platenum:
- {
- remote: "Plate Number entered already exists"
- },
- chassisnum:
- {
- rangelength: "Enter between 10 to 17 characters"
- },
- mvfnum1:
- {
- minlength: "Enter the first 4 numbers"
- },
- mvfnum2:
- {
- rangelength: "Enter beween 6 to 12 numbers"
- }
-
- },
- groups:
- {
- mvfnum: "mvfnum1 mvfnum2"
- },
- errorPlacement: function(error, element)
- {
- if (element.attr("name") == "mvfnum1" || element.attr("name") == "mvfnum2" )
- {
- error.insertAfter("#mvfnum2");
- }
- else
- {
- error.insertAfter(element);
- }
- },
- submitHandler: function()
- {
- $.ajax
- ({
- type: "post",
- url: "addmorecar_p2",
- data: "brand=" + $('#brand').val(),
- success: function(data)
- {
- $('#addvi').fadeOut(function()
- {
- $('#addii').html(data).fadeIn();
- });
- }
- });
- }
- });
here is the animation code
- $('#acsubmit').live('click',function()
- {
- $.ajax
- ({
- type: "POST",
- data: $("#reg_addcar").serialize()+'&'+'mortgator='+$('#mortgator').val(),
- url: "addcarsubmit",
- success: function(data)
- {
- $('.vicontainer').html(data);
- $('#regaddcar').fadeOut();
- $('#addvehicle').removeAttr('disabled').css('color','#000');
- }
- }); //end of the ajax
- return false
- });
-
- $('#acback').live('click',function()
- {
- $('#addii').fadeOut();
- $('#addvi').fadeIn();
- });