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

Q303 How can I force all characters to be uppercase before the user submits the form?

You are here: irt.org | FAQ | JavaScript | Text | Q303 [ previous next ]

Use the toUpperCase() method on each and every form field:

<SCRIPT LANGUAGE="JavaScript"><!--
function convert() {
    document.myForm.myText1.value = document.myForm.myText1.value.toUpperCase();
    document.myForm.myText2.value = document.myForm.myText2.value.toUpperCase();
}
//--></SCRIPT>

<FORM NAME="myForm" onSubmit="convert()">
<INPUT TYPE="TEXT" NAME="myText1">
<INPUT TYPE="TEXT" NAME="myText2">
<INPUT TYPE="SUBMIT">
</FORM>

Feedback on 'Q303 How can I force all characters to be uppercase before the user submits the form?'

©2018 Martin Webb