EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: devnull on February 25, 2015, 09:43:10 PM



Title: Form Validation of Field in hidden tab [Solved]
Post by: devnull on February 25, 2015, 09:43:10 PM
Hi;

When submitting a form that has tabs with input validate boxes, the user is not aware of the validation failure of the hidden fields.

As there is only a true/false response to the form().validate() method, I am unable to tell which field failed the validation.

Can the function be changed to enable the tab that the failed validation field is a child of  and / or provide the input that failed the validation.




Title: Re: Form Validation of Field in hidden tab
Post by: stworthy on February 26, 2015, 07:02:12 AM
The code below shows how to get all the invalid inputing boxes.
Code:
$('#ff').form('submit',{
onSubmit: function(){
var isValid = $(this).form('validate');
if (!isValid){
var inputs = $(this).find('.textbox-invalid').prev();
console.log(inputs)
}
return isValid;
}
});


Title: Re: Form Validation of Field in hidden tab
Post by: devnull on February 26, 2015, 08:18:37 PM
Thanks :-)