0

setValue on onclick?

asked 2014-02-19 19:25:15 +0800

sapot gravatar image sapot
3 1

updated 2014-02-19 21:33:33 +0800

chillworld gravatar image chillworld flag of Belgium
5322 4 9
https://github.com/chillw...
<textbox id="clearbox" value="XYZ" />
<button id = "clearbutton" onClick="clearbox.setValue('ssss')">Clear Text</button>

When I click the button I want to change the value of my textbox but my code doesn't work because of parsing errors.

How to do this?

delete flag offensive retag edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2014-02-19 21:53:45 +0800

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

see this fiddle :

http://zkfiddle.org/sample/bjjro3/1-setValue-on-onclick

greetz chill

link publish delete flag offensive edit
0

answered 2014-02-20 05:49:32 +0800

MVarun gravatar image MVarun flag of India
268 1 6

Hi sapot,

Try This...

clearbutton.addEventListener("onClick", new EventListener()
{
      public void onEvent(Event evt)
      {
          clearbox.setText("new Text");
      }
}

Greetings...

M Varun.

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
1 follower

RSS

Stats

Asked: 2014-02-19 19:25:15 +0800

Seen: 15 times

Last updated: Feb 20 '14

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