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 comment

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