Friday, 17 August 2012

jQuery Validationengine arrows not showing (ASP.NET)

On a recent project the customer wanted to display custom error messages.  To achieve this I had to write my custom validation method as opposed to using the css="validate[required]".

This was fine until I hit the issue where by when calling the showPrompt method as follows:

if ($j("#lstCustomerType").val() == "") {
             jQuery('#lstCustomerType').validationEngine('showPrompt', 'Please select a customer type', 'error', true);
     }
The validation message was showing but was not including the nice little arrow despite me passing the variable of "true" for this optional parameter.

The solution for this was to pass all the optional variables through to the method as follows:

             jQuery('#lstCustomerType').validationEngine('showPrompt', 'Please select a customer type', 'error', 'topRight', true);

No comments:

Post a Comment