EasyUI Forum

General Category => Bug Report => Topic started by: eggbert on September 14, 2011, 11:17:22 AM



Title: datebox validation does not behave like validatebox
Post by: eggbert 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.


Title: Re: datebox validation does not behave like validatebox
Post by: stworthy 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(){
//...
}
});


Title: Re: datebox validation does not behave like validatebox
Post by: Anthony Artmann 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?


Title: Re: datebox validation does not behave like validatebox
Post by: ndujosh on June 28, 2013, 02:24:43 AM
same issue here. Sworthy's solution doesn't work


Title: Re: datebox validation does not behave like validatebox
Post by: stworthy 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.