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 Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

inserting text from buttons into mulitiple text boxes

Status
Not open for further replies.

gavinm

Technical User
Jul 13, 2001
1
GB
Will you please answer this question
if i had three buttons one marked 1 the other 2 and the 3
if the user clicks 1 the number one is entered into the first text box
if the user clicks 2 the number two is entered into the second text box
if the user clicks 3 the number three is entered into the second text box
N.B the user can click on any button at random so if the user clicks the number 2 the the number two is entered into the first text box.
Thank you very much
 
So you want to take the button value:

function display(obj_button,obj_target){
obj_target.value = obj_button.value;
}


<input type=&quot;button&quot; value=&quot;1&quot; onClick=&quot;display(this,text1)&quot;>

<input type=&quot;text&quot; name=&quot;text1&quot;>

function requires you to send the button clicked, and the object to which you want to write the data. the obj
prefix just indicates the type of data to send to the function, in this case object.
b2 - benbiddington@surf4nix.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top