Entry
With the event "OnClick", can I input into the currently focused or selected cell of an html form?
Nov 9th, 2004 13:57
Ky Dang, Steve Lester,
I am assuming you have FOCUS on the text box within the form.
The only thing you need now is to put this following command in your
function.(Where "myForm" is the name of the form, T1 is the name of the
textbox, and var1 is some variable value.)
document.myForm.T1.value = var1;
*****************************************
If you don't have focus, put the following code after the form loads
the textbox "T1" or better yet, preferably the line before the </body>
tag.
<script>document.myForm.T1.select()</script>
** Or this code will focus as well *******
<script>document.myForm.T1.focus()</script>