Discussion Locked

HTML - VB Script - Java

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
In a webpage form I want to put focus on a particular text box when a particular checkbox or radio button is selected.

5 replies

by devry student

You need to add onclick to the list of attributes for either the checkbox or the radio button, and use that event to call a Subroutine which sets the focus to your text box. i.e.:
Basic checkbox:

And the function:

This sets the focus to txtTextBox when chkBox is clicked on.

by jay eckles

You did include "VB Script" in your question title, but if you really want to do this on a public webpage, I recommend you use Javascript. It will work just as well in IE and you won't automatically exclude every non-IE browser out there. Try thisscript:

This discussion is closed to new replies.