473,402 Members | 2,064 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

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

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
2 1708
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: johnsuth | last post by:
I want to produce a trivial demonstration of dynamic modification. I thought that pressing a button might change its color. I studied O'Reillys books and successfully created the button with a...
2
by: Peter | last post by:
Hi, this is the code, and new row and new cell generated ok, but why the onclick and onmouseover doen't work? Thank you in advance! <html> <head> <script language="javascript"> function...
2
kestrel
by: kestrel | last post by:
i had it a while ago, but i forgot... heres what i have.<input type="button" value="Submit" onclick="this.disabled=1; this.value=Sending;"> i can get the button to disable, but the value wont...
2
by: bay_dar | last post by:
Hi, I have an internal ASP.NET application that I'm are using to send e-mails out based on a single milepost or milepost range entered. I'm trying to do two things when a user clicks on the...
13
by: alvin.yk | last post by:
Hi, Normally, a piece of code such as <a href="http://www.yahoo.com" onclick="alert('hello');return false;">link</a> will stop the browser from actually going to href's destination....
11
by: jesdynf | last post by:
I'm having trouble applying a stylesheet to content I'm generating after the fact. Here's the sample code: <html> <head> <title>CSS/DOM Problem Example</title> <style type="text/css">...
5
by: Diwa | last post by:
Does the "value" type (value as in key-value pair )of "std::map" require a default ctor even if it is not used ? If I comment out Line 1 in the code attached later, i.e remove the default ctor...
2
by: ejrfigueiredo | last post by:
Hi, Is there a way to get a script function to save a page without the execCommand (which works on IE but doesn't on Firefox). Below there's the code I'm using, I took it from a template page...
3
by: PVACC | last post by:
I have a line of code thus: w3('<input type=radio name=rad onclick="parent.mySub('+i+')">'); The function w3() writes the code in an iframe. I need to set a variable "start" to the value "1"...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.