EasyUI Forum
March 29, 2024, 03:20:09 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: How can I return all invalid fields of Form?  (Read 8207 times)
mauroxavier
Newbie
*
Posts: 3


View Profile
« on: September 30, 2014, 08:19:59 AM »

How can I return all invalid fields of Form? 

I have a form and want a list of all fields that have not been validated by the function $('#form').form('validate')
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: September 30, 2014, 05:03:02 PM »

The invalid input box has 'validatebox-invalid' class. Search all these input boxes and you will be able to get all the invalid form fields.
Code:
var fields = $('#ff').find('input[textboxName]').filter(function(){
return $(this).textbox('textbox').hasClass('validatebox-invalid');
});
fields.each(function(){
if ($(this).hasClass('datebox-f')){
// is datebox
} else if ($(this).hasClass('textbox-f')){
// is textbox
}
})
Logged
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!