Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q743 How can I set the selected option of a select form field?

You are here: irt.org | FAQ | JavaScript | Form | 10.1 | Q743 [ previous next ]

If you've got the value, say within:

var myVar = 3;

then use:

window.formName.selectName.options[myVar].selected = true;

©2018 Martin Webb