We use a plug-in called jQuery-Validation-Engine for form validation.
When there is an error, a balloon appears and disappears when you click on the balloon.
Is there any way to keep it from disappearing even if I click this?
I read this, but I didn't understand it at all.
https://github.com/posabsolute/jQuery-Validation-Engine#options
Thank you for your cooperation.
jquery
As far as the source code is concerned, there seems to be no branch that prevents the error prompt from disappearing when clicked.
/**
* Kind of the constructor, called before any action
* @param {Map} user options
*/
init:function(options){
var form = this;
if(!form.data('jqv')||form.data('jqv')==null){
options=methods._saveOptions(form, options);
// bind all formError elements to close on click
$(document).on("click", ".formError", function(){
$(this).fadeOut(150, function(){
// remove prompt once invisible
$(this).close('.formError') .remove();
});
});
}
return this;
},
If you really want to keep the prompt from disappearing when you click, you may have to modify the local source code or submit such an option to your request.
If you modify the local source code and add the option (e.g.hideOnClick
), would that be like this?
$(document).on("click", ".formError", function(){
if(!options.hideOnClick)return;
$(this).fadeOut(150, function(){
// remove prompt once invisible
$(this).close('.formError') .remove();
});
});
© 2024 OneMinuteCode. All rights reserved.