0

Zk+JavaScript

asked 2010-03-03 07:38:51 +0800

basilio gravatar image basilio
12

Hi, I have the following code but it doesnt work, anyone knows why?

<?xml version="1.0" encoding="UTF-8"?>

<zk xmlns="http://www.zkoss.org/2005/zul">
<window>
<zscript type="text/JavaScript" language="javascript">
function mascara(o,f){
v_obj=o
v_fun=f
setTimeout("execmascara()",1)
}

function execmascara(){
v_obj.value=v_fun(v_obj.value)
}
function cpf(v){
v=v.replace(/\D/g,"")
v=v.replace(/(\d{3})(\d)/,"$1.$2")
v=v.replace(/(\d{3})(\d)/,"$1.$2")

v=v.replace(/(\d{3})(\d{1,2})$/,"$1-$2")
return v
}


</zscript>
<textbox id="cpf" width="150px" onChanging="javascript: mascara(this,cpf)" />
</window>
</zk>

delete flag offensive retag edit

1 Reply

Sort by ยป oldest newest

answered 2010-03-03 19:03:06 +0800

PeterKuo gravatar image PeterKuo
481 2

By searching "client javascript"
you may refer to the thread:
http://www.zkoss.org/forum/listComment/10823

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

Follow

RSS

Stats

Asked: 2010-03-03 07:38:51 +0800

Seen: 495 times

Last updated: Mar 03 '10

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