Convert a Letter UPPERCASE

[Total: 1    Average: 5/5]

This example will change one letter of your choice per function call from lower case to upper case.

Body Code:

function toUp(tci,ch)
  var result="";
    /* Looking for the CHARACTER if it exits then dont do anything */
    tci.value = tci.value;
    /* Character Exists */
    var str = tci.value.split('');
    for(i=0; i<=str.length-1; i++)
        /* here update the Character within the LOOP */
        str[i]  = str[i].toUpperCase();
      /* save the output to the resule variable which was set to a blank string in the begining */
    /* and Finaly set the value of your textBox equall to the result variable */	
    tci.value = result;

This example looks for the letter "s" to change to upper case.
<form method="POST" name="f1">
<BR><input type="text" name="t1" size="20">
<BR><input type="button" value="Update" name="B1" onClick="toUp(t1,'s')">
<input type="reset" value="Reset" name="B2">

Times Viewed: 8

Leave a Reply

Your email address will not be published. Required fields are marked *