Just some random stuff. This post was saved as a draft a long time ago because I needed to refer to one of these – but was waiting until I could find the original source to publish. It's pretty generic/basic stuff, though, (and a really small snippet) so I'm finally posting it.
To set the value of a text element, the following syntax is used:
document.formName.elementName.value = elementValue;
To set a select element, the following syntax is used:
document.formName.elementName.selectedIndex = elementValue;
(also see this post: Javascript Sect Selection in Select Element)
To set a radio element, the following syntax is used:
document.formName.elementName[elementValue].checked = true;
To set a checkbox element, the following syntax is used:
document.formName.elementName.checked = true