Click to See Complete Forum and Search --> : putting a value in selected text box from a variable by clicking a button


akrashdi
12-04-2003, 10:06 AM
Hello Friends !

How can I put a value from a variable into a SELECTED text box on my html page?

I mean in whichever text box my cursor is , the button should put the value in that text box.

Waiting for help.

Thanks and Regards
A.K.R

fredmv
12-04-2003, 10:12 AM
Can you please be more descriptive as to what you're trying to do?

TheBearMay
12-04-2003, 11:46 AM
The onfocus event for the textbox can be used to set a variable that will allow you to track which box had focus just prior to clicking your button - when you click the button the button has focus. After that it's just a matter of setting the textbox.value property.