hey rick
great job
i got some question
its works good, but if i got the same / diffrent error, its duplicates me
the error message, like "error, this field must be 15 chars at least error,
this field must be 15 chars at least error, this field must be 15 chars at
least"

and if the field is corrected or ok, its just not disappear the div error
msg... how can i fix it?


Rick Faircloth wrote:
>  
> Hi, amircx...
> 
> Here's some code I'm using... I just started jQuery about 2 weeks ago,
> myself.
> You'll see the rules and corresponding messages in the code.
> 
> Rick
> 
> $().ready(function() {
> 
>         // validate Mortgage_Calculation_Form form fields on keyup
>         $("#MC_Form").validate({
>       
>        errorPlacement: function(error, element) {
> 
>             if(element.attr('id') == "Principal") {
>                error.appendTo("#principal_error");
>                }
>               
>                else
>                
>            if(element.attr('id') == "Interest") {
>                error.appendTo("#interest_error");
>                }
>                       
>                else
>                       
>            if(element.attr('id') == "Years") {
>                error.appendTo("#years_error");
>                }
>                       
>       },//closes errorPlacement function
> 
>       focusInvalid: "false",
>                       
>       event: "keyup",
>                       
>       rules: {
>                       
>           Principal: {required: true,
>                        digits: true},
>           Interest: {required: true,
>                       number: true},
>           Years: {required: true,
>                    number: true}
>               },
> 
>       messages: {
>                       
>           Principal: {required: "Please enter the Principal.",
>                         number: "Please enter a number.  Format: 255000 (No $ 
> or , )"},
>           Interest: {required: "Please enter the Interest Rate.",
>                         number: "Please enter a number."},
>           Years: {required: "Please enter the Years.",
>                    number: "Please enter a number."}
>                  },
> 
> 
>       submitHandler: function(){
> 
>              // Call CalculateMortgage
>              CalculateMortgage();
> 
>       } // closes the submitHandler function
> 
>     }) // closes the ) before the .validate bracket? 
>     }); // closes the .validate bracket
> 
> 
> 
> 
> 
> _______________________________________________
> jQuery mailing list
> [email protected]
> http://jquery.com/discuss/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/forms-validation-error-divs---help-tf3389341.html#a9453627
Sent from the JQuery mailing list archive at Nabble.com.


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to