0

How to Disable Mandatory Constraint for email textbox

asked 2014-04-02 19:14:54 +0800

sathishk gravatar image sathishk
17 5

updated 2014-04-03 05:48:43 +0800

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

Hi sir,

The Below given Constrain for email, If i Enter empty string it's shows validation popup,in this case i need to disable popup of email constrain and remove mandatory field,How to do? Validation work only when i enter any String only,but here two ways display popup.

Please give me suggestions.I am new in ZK.

<label class="bold">Email</label>
<textbox id="emailid" 
    constraint="/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/: Please enter an e-mail address">
</textbox>
delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-04-03 05:48:27 +0800

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

First of all, regex is widly used, not only zk.

Now for your problem :

constraint="/^$|\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/: Please enter an e-mail address"

where ^$ stand for empty string and | for OR.

Greetz chill.

link publish delete flag offensive 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
2 followers

RSS

Stats

Asked: 2014-04-02 19:14:54 +0800

Seen: 13 times

Last updated: Apr 03 '14

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