posabsolute / jQuery-Validation-Engine

jQuery form validation plugin
http://www.position-absolute.com/articles/jquery-form-validator-because-form-validation-is-a-mess/
2.57k stars 1.2k forks source link

Showprompt message disappearing on select #941

Open Niranjan-KC opened 7 years ago

Niranjan-KC commented 7 years ago

Hi, I am trying to make a simple custom validation on a select. The select needs to have a value selected when another textbox is entered otherwise it need not validate. This is my HTML <select id="selectid" class="validate[funcCall[validateSelect]]"></select>

Here is my method function validateSelect(field, rules, i, options) { if ($("#textboxid").val().length > 0 && !($(selectid).val() > 0)) $("#selectid").validationEngine('showPrompt', 'Error Message', 'error', 'topRight', true); }

This triggers the validation and the message appears but it disappears immediately. I have not set any fade outs. Appreciate any help.