0

Validate datebox invalid input with validators

asked 2014-11-05 11:57:11 +0800

eclipse1 gravatar image eclipse1
21 4

Hi, If a user types a letter/invalid format in a datebox and moves focus to another form field, ZK triggers constraint validation and shows a message with the error message. I use datebox in forms with many other inputs that have business validations that I am supporting implementing validators triggered by the save action. Is there a way to unplug invalid format constraint in datebox? Is there a way to find out from the validator that a datebox has letter/invalid format input? I would like to show all form validation messages only after save action. Regards

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-11-05 16:39:15 +0800

chillworld gravatar image chillworld flag of Belgium
5322 4 9
https://github.com/chillw...

Hi there.

You can use like constraint="no empty"

Then you just need to do the following :

<groupbox form="@id('fx') @load(vm.selected) @save(vm.selected, before='saveOrder') >
    <datebox value="@bind(fx.creationDate)" constraint="no past,no empty"/>
    <button label="save" onClick="@command('saveOrder')"/>
</groupbox>
link publish delete flag offensive edit
0

answered 2014-11-11 14:44:02 +0800

eclipse1 gravatar image eclipse1
21 4

When I say "I would like to show all form validation messages only after save action", I suppose I cannot use any constraints, including internal constraints. Thanks

link publish delete flag offensive edit

Comments

so you just want the model do the validation?

chillworld ( 2014-11-11 15:40:30 +0800 )edit

Yes, that's it!

eclipse1 ( 2014-11-17 19:06:09 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2014-11-05 11:57:11 +0800

Seen: 39 times

Last updated: Nov 11 '14

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More