0

about the textbox ,show '01' value, when onFocus show another value 'Company'

asked 2010-01-22 05:09:06 +0800

dellsoft gravatar image dellsoft
114 2

a Map data ,key = 01 value =Company
i need the textbox show Company ,but when i edit the textbox (such as onFocus the textbox) it show the 01

how to carry out ?

delete flag offensive retag edit

2 Replies

Sort by » oldest newest

answered 2010-01-22 09:22:32 +0800

kesavkolla gravatar image kesavkolla
180 3

There are two ways to do that.

1) Server way

<textbox id="txtData" value="company" onFocus='self.setValue((String)self.getAttribute("key"))'
onBlur='self.setValue((String)self.getAttribute("value"))'>
<custom-attributes key="01" value="company" />
</textbox>

2) Client way using jquery
<zk xmlns:w="http://www.zkoss.org/2005/zk/client">
<textbox id="txtData1" value="company">
<attribute w:name="onFocus">$("$txtData1").val("01");</attribute>
<attribute w:name="onBlur">$("$txtData1").val("company");</attribute>
</textbox>
</zk>

HTH
-kesav

link publish delete flag offensive edit

answered 2010-01-24 00:39:53 +0800

dellsoft gravatar image dellsoft
114 2

kesavkolla : thanks ,it is ok!

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-01-22 05:09:06 +0800

Seen: 387 times

Last updated: Jan 24 '10

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