1

ZK Customize the error message for Constraints

asked 2014-09-01 06:27:44 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

I am using zk textbox with constraint something like this

<textbox constraint="no empty , /^[a-zA-Z]+\s?[a-zA-Z]+$"  />

Now issue is that rater showing proper error message its showing illegal value i want to know how to customize the error message ? So when user will input any wrong value it will show proper error message

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2014-09-01 07:28:36 +0800

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

updated 2014-09-01 10:52:59 +0800

Hi Sjoshi do the following :

<textbox constraint="no empty , /^[a-zA-Z]+\s?[a-zA-Z]+$/: your message"  />

Edit 1 :

difference : put a / after your regex.

Edit 2 :

Internationalisation :

If I'm correct this should work (after zk 5.0.7) :

<textbox constraint="no empty , /^[a-zA-Z]+\s?[a-zA-Z]+$/: ${labels.app.title}"  />

Edit 3 :

Example :
I create a fiddle with test to show the version number, with is the same principal as I18N.

Greetz chill.

link publish delete flag offensive edit

Comments

I tried that also before posting here but its didnt worked

sjoshi ( 2014-09-01 07:54:11 +0800 )edit

what version? I use it in 6.5.3 and it works there (but have not the no empty) can you try it with removing the no empty?

chillworld ( 2014-09-01 08:00:22 +0800 )edit

ZK[Breeze7.0.2] i am testing it in zkfiddel..even after i remove the noempty it is showing same exception illegal value

sjoshi ( 2014-09-01 08:02:37 +0800 )edit

try it with my constraint

sjoshi ( 2014-09-01 08:32:19 +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-09-01 06:27:44 +0800

Seen: 31 times

Last updated: Sep 01 '14

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