I was wondering what the easiest and best way for a beginner like myself to set up a keypad with numbers only and have them incorporate it to a text area or box, basically the user will click the button and the number that is pressed will show up in the textarea or text box. I am wondering what the best way to do this is.

<input type="image" id="1" src="Button1.gif" alt="Calculator Button #1"/>
This is the line of code (an example of it) that I am working with. So my question is what is the best way to do this.

Hey this works, but now the problem is that is just shows up briefly and then disappears at the same time when the button is clicked.When I do this for #2 button it does the same thing. I made it way harder than it needed to be when I tried to do it myself.

jmrker

03-09-2012, 11:48 PM

Show some more of your code.
I suspect you are using a <form...> tag.
If I'm correct, modify it to something like this...

<form name="myForm" action="" method="post" onsubmit="return false">

pbracing33b

03-10-2012, 01:51 AM

Thank you very much that was exactly it. B4 this I tried adding event listeners to this and that is so much harder to do than what you've shown me here. So I am very grateful.:thumbsup:

jmrker

03-10-2012, 02:29 AM

Thank you very much that was exactly it. B4 this I tried adding event listeners to this and that is so much harder to do than what you've shown me here. So I am very grateful.:thumbsup:

You're most welcome.
Happy to help.
Good Luck!
:)

Note: If you submit your event listener attempt we might be able to fix it.