Forum Moderators: mack

Message Too Old, No Replies

VBScript

Need Help

         

aluann

1:48 am on Jan 20, 2004 (gmt 0)



How do I get the cursor to automatically go to the first box on a form after I get a result in the last box.
Building a calculator?

Purple Martin

5:45 am on Jan 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You need a bit of JavaScript, for example:

onChange="document.forms[0].elements[0].focus()"

This goes in the tag for the last field. Here's how it works:
onChange - specifies what to do when that field changes.
document.forms[0] - refers to the first form in the document (start counting from zero).
elements[0] - refers to the first field in the form.
focus() - this method gives the specified field the focus.

iamlost

6:52 pm on Jan 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Your question says you are are using VB script. If so you want something like:

FirstBox.SetFocus