EasyUI Forum
September 14, 2025, 02:49:26 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Form Validation of Field in hidden tab [Solved]  (Read 8899 times)
devnull
Sr. Member
****
Posts: 431


View Profile
« 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.


« Last Edit: February 26, 2015, 08:18:51 PM by devnull » Logged

-- Licensed User --
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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;
}
});
Logged
devnull
Sr. Member
****
Posts: 431


View Profile
« Reply #2 on: February 26, 2015, 08:18:37 PM »

Thanks :-)
Logged

-- Licensed User --
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!