Selectbox - constraint="no empty" not working

asked 2016-04-13 08:06:15 +0800

Ricko gravatar image Ricko

Want to set no empty for Selectbox

Hi, I am new to ZK. After spending some time with ZK MVVM and Spring I really like it. Now I am planning to develop a small online job application System using ZK 8 MVVM and Spring.

I have an application form with many textboxes and selectboxes. For required textboxes I can easily set

constraint="no empty"

But for selectboxes I have no option. I have created one FormValidator. I want to have same user experience during validation for all input elements in my form.

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2016-04-14 06:03:50 +0800

Darksu gravatar image Darksu
1991 1 4

Hello Ricko,

Please use the following script as a reference:

<?page title="new page title" contentType="text/html;charset=UTF-8"?>
        java.util.ArrayList list = new java.util.ArrayList();
        list.add("option 1");
        list.add("option 2");
        list.add("option 3");
        org.zkoss.zul.ListModelList model = new org.zkoss.zul.ListModelList(list);
    <selectbox model="${model}" xmlns:w="client">
        <attribute w:name="doBlur_"><![CDATA[
            function(evt) {
                if (this.$n().value == '') {
                    zAu.wrongValue_(this, 'Please select.....');
                } else {

Best Regards,


link publish delete flag offensive edit
Your reply
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

1 follower



Asked: 2016-04-13 08:06:15 +0800

Seen: 32 times

Last updated: Apr 14 '16

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