By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,841 Members | 840 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,841 IT Pros & Developers. It's quick & easy.

onclick= Editbox1.value+"1" wont work!

P: n/a
Hi,

Anyone knows how this works?

I have made a textbox called Editbox1 and 10 buttons. b0, b1, b2 etc.

What i want to do is when i press a button, b1 for example, a number 1
appears into the textbox (editbox1)
But i dont want to erase the other numbers that are already in the textbox.

If i do this: onclick= Editbox1.value="1" the 1 appears to the textbox, but
it will erase the other numbers. I dont want that!

I tried to do this:

onclick= Editbox1.value+"1"

and this

onclick= Editbox1.value&"1"

and so on. I tried everything... but it wont work.
Can anyone help me. I know this must be very simple, so i must be a morron.

Thx,
JaSt
Nov 25 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
RTF said the following on 11/26/2007 4:27 AM:

<snip>
i think parseInt(Editbox1.value)+1; can solve this problem.
You should try reading the pages I linked to in my first reply. Then you
might know why you think wrong.

Type in "09" in a text input, test your code, then get back to us on how
well it "solves the problem".

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 26 '07 #2

P: n/a
RTF
On 11月26日, 下午5时35分, Randy Webb <HikksNotAtH...@aol.comwrote:
RTF said the following on 11/26/2007 4:27 AM:

<snip>
i think parseInt(Editbox1.value)+1; can solve this problem.

You should try reading the pages I linked to in my first reply. Then you
might know why you think wrong.

Type in "09" in a text input, test your code, then get back to us on how
well it "solves the problem".

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/
oh,i am sorry,i didn't understand all of his mean,so make wrong!at
first,i think only the problem of the number.you
are right.
Nov 26 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.