Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with on Click 1

Status
Not open for further replies.

cabv00

Technical User
Feb 9, 2002
15
0
0
US
I need some help to do the following
I will have 10 buttons on a webpage each displaying a number 0-9 and I need to have employees enter their employee # in a text field by clicking the buttons. Can anyone point me in the right direction??

P.S.
This will be a touch screen so there is no keyboard!


Thanks.. Carlos
 
Try this:

function tipe(num)
{
document.frm.txtbox.value=document.frm.txtbox.value + num
}

And your buttons should look like this:
<input type=&quot;button&quot; name=&quot;b9&quot; value=&quot; 9 &quot; OnClick=&quot;tipe('9')&quot;>

Hope it'll help
Have Fun...

Sharky99 >:):O>
 
I am really a newbie to programming so this is a little Chinese to me. I got the idea but if you have a little more detail I would appreciate it

thanks... C
 
Hi,

Try this code below, I just dont know if onpress() will work in touch screen so, if it will not try onclick():

<html>
<head>
<title>touch screen</title>
<script>
function dataval(no) {
document.form1.noemployee.value=document.form1.noemployee.value + no;
}
</script>
</head>

<body bgcolor=&quot;#FFFFFF&quot; text=&quot;#000000&quot;>
<form name=&quot;form1&quot; method=&quot;post&quot; action=&quot;&quot;>
<br>
<input type=&quot;text&quot; name=&quot;noemployee&quot;>
<br>
<input type=&quot;button&quot; name=&quot;Button&quot; value=&quot;0&quot; onpress=&quot;dataval(0);&quot;>
<input type=&quot;button&quot; name=&quot;Submit2&quot; value=&quot;1&quot; onpress=&quot;dataval(1);&quot;>
<input type=&quot;button&quot; name=&quot;Submit3&quot; value=&quot;2&quot; onpress=&quot;dataval(2);&quot;>
<input type=&quot;button&quot; name=&quot;Submit4&quot; value=&quot;3&quot; onpress=&quot;dataval(3);&quot;>
<input type=&quot;button&quot; name=&quot;Submit5&quot; value=&quot;4&quot; onpress=&quot;dataval(4);&quot;>
<br>
<input type=&quot;button&quot; name=&quot;Submit6&quot; value=&quot;5&quot; onpress=&quot;dataval(5);&quot;>
<input type=&quot;button&quot; name=&quot;Submit7&quot; value=&quot;6&quot; onpress=&quot;dataval(6);&quot;>
<input type=&quot;button&quot; name=&quot;Submit8&quot; value=&quot;7&quot; onpress=&quot;dataval(7);&quot;>
<input type=&quot;button&quot; name=&quot;Submit9&quot; value=&quot;8&quot; onpress=&quot;dataval(8);&quot;>
<input type=&quot;button&quot; name=&quot;Submit10&quot; value=&quot;9&quot; onpress=&quot;dataval(9);&quot;>
</form></body></html>

Hope this solve your problem.
 
thanks
this worked great with onclick

Carlos
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top