Conversion of string into uppercase

The below function is used to convert the alphabets into uppercase

function convertToUpper(){
var field1 = document.formName.elementName

field1.value = field1.value.toUpperCase();

Example :
If the formName is StudentForm and element name is student id like stud100

Then ,
function convertToUpper(){
var field1 = document.StudentForm.StudentId

field1.value = field1.value.toUpperCase();


gives the value as STUD100.

One thought on “Conversion of string into uppercase

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.