EasyUI Forum
May 09, 2024, 06:58:06 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: datebox validation does not behave like validatebox  (Read 24320 times)
eggbert
Newbie
*
Posts: 16


View Profile Email
« on: September 14, 2011, 11:17:22 AM »

With datebox the validation behaviour differs from validatebox.

For example, with a validatebox, the validation warning does not appear until the user clicks on the field. However, with datebox the validation warning shows up instantly when the form is loaded.

Secondly, when the form is submitted an invalid datebox does not even prevent the form from being submitted.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: September 15, 2011, 12:29:23 AM »

When call 'load' method to load form data, all the form fields will be validated. It is a way to indicate user if the data is valid.

You can write some code in 'onSubmit' event to determine if the form can be submitted.
Code:
$('#f').form('submit',{
onSubmit:function(){
return $(this).form('validate'); // prevent invalid data to be submitted
},
success:function(){
//...
}
});
Logged
Anthony Artmann
Newbie
*
Posts: 3


View Profile Email
« Reply #2 on: April 02, 2013, 06:12:19 PM »

...with a validatebox, the validation warning does not appear until the user clicks on the field. However, with datebox the validation warning shows up instantly when the form is loaded.

I am having this problem too.

Can you recommend a solution?
Logged
ndujosh
Newbie
*
Posts: 1


View Profile Email
« Reply #3 on: June 28, 2013, 02:24:43 AM »

same issue here. Sworthy's solution doesn't work
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #4 on: July 02, 2013, 02:48:23 AM »

The updated validatebox plugin is available from http://www.jeasyui.com/easyui/plugins/jquery.validatebox.js. Now all the validatebox will display validation warning when failed to validate.
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!