Revision history [back]

click to hide/show revision 1
initial version

asked 2013-01-02 09:01:37 +0800

iamsudhir4u gravatar image iamsudhir4u flag of India

http://corejavasupport.bl...

Facing issue in masking on phone

I have applied masking on phone fields. I am facing one issue.

Suppose you have applied masking on phone for ("(999) 999-9999") format. ZK will prefill the phone field value with masked only if phone field value size is 10. If size of phone field value is less than 10 than in ZK will prefill the phone text box with blank.

I have followed below link.

http://www.zkoss.org/zkdemo/effects/form_effect

I have written below code on my zul file.

<script type="text/javascript" src="/resource/js/jquery.maskedinput-1.2.2.min.js"/> <script type="text/javascript"> zk.afterMount(function() { $.mask.definitions['A']='[A-Z]'; $.mask.definitions['m']='[01]'; $.mask.definitions['d']='[0123]'; $.mask.definitions['y']='[12]'; jq("$phone1").mask("(999) 999-9999"); jq("$phone2").mask("(999) 999-9999"); jq("$phone3").mask("(999) 999-9999"); }); </script>

Facing issue in masking on phone

I have applied masking on phone fields. I am facing one issue.

Suppose you have applied masking on phone for ("(999) 999-9999") format. ZK will prefill the phone field value with masked only if phone field value size is 10. If size of phone field value is less than 10 than in ZK will prefill the phone text box with blank.

I have followed below link.

http://www.zkoss.org/zkdemo/effects/form_effect

I have written below code on my zul file.

<script type="text/javascript" src="/resource/js/jquery.maskedinput-1.2.2.min.js"/>
type="text/javascript"
            src="/resource/js/jquery.maskedinput-1.2.2.min.js" />
        <script type="text/javascript">
            zk.afterMount(function() { $.mask.definitions['A']='[A-Z]';
            $.mask.definitions['m']='[01]';
            $.mask.definitions['d']='[0123]';
            $.mask.definitions['y']='[12]';

            jq("$phone1").mask("(999) 999-9999");
            jq("$phone2").mask("(999) 999-9999");
            jq("$phone3").mask("(999) 999-9999");

            });
        </script>

Facing issue in masking on phone

I have applied masking on phone fields. I am facing one issue.

Suppose you have applied masking on phone for ("(999) 999-9999") format. ZK will prefill the phone field value with masked only if phone field value size is 10. If size of phone field value is less than 10 than in ZK will prefill the phone text box with blank.

I have followed below link.

http://www.zkoss.org/zkdemo/effects/form_effect

I have written below code on my zul file.

<script type="text/javascript"
            src="/resource/js/jquery.maskedinput-1.2.2.min.js" />
        <script type="text/javascript">
            zk.afterMount(function() { $.mask.definitions['A']='[A-Z]';
            $.mask.definitions['m']='[01]';
            $.mask.definitions['d']='[0123]';
            $.mask.definitions['y']='[12]';

            jq("$phone1").mask("(999) 999-9999");
            jq("$phone2").mask("(999) 999-9999");
            jq("$phone3").mask("(999) 999-9999");

            });
        </script>
Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More