简体   繁体   中英

Jquery validation engine message not visible

I'm using the following code to pump a message to JQuery validation engine:

$(".ref2").validationEngine("showPrompt", "Please enter your references if you can", "error");

The issue is odd, when you submit the form with incorrect references, the error message is shown, closing the message and trying to resubmit appears to do nothing, the form doesn't submit and the error message doesn't show up.

I've investigated and the error message IS being created, the div element exists but you just can't see it? Am I wrong in thinking you can just resend a prompt?

The error turned out to be that the Validation engine was being called twice in quick succession. What this did in this specific case was to set the Z index of the validation message to -50.

I believe this to be quirk of the poorly formed javascript that was being used on the page at the time, as each successive call decremented the Z index by 25. So it was being hidden behind a label.

Removing the second call fixed the problem, and moving away to FluentValidation fixed my sanity.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM