Converting Strings to Upper Case : String : Language Basics JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Language Basics » String »

 

Converting Strings to Upper Case



<HTML>
<HEAD>
<TITLE>Validate</TITLE>
<SCRIPT
function checkLawyer(str) { 
   if ((str.toUpperCase() == "JOE"|| (str.toUpperCase() == "JOHN")) 
         alert ("JOHN and JOE are not allowed here...")
   else 
      alert("Your application will be evaluated!")

</SCRIPT>
</HEAD>
<BODY>
<FORM name="theForm">
<TABLE>
<tr><td>Enter Your First Name (*): </td>
    <td><INPUT type=text name="userFname"></td>
</tr>
<tr><td>Enter Your Profession (*): </td>
    <td><INPUT type=text name="userProf"></td>
</tr>
<tr>
<td colspan=2>
<INPUT type=button name="theButton" value="SUBMIT QUERY" onClick="checkLawyer(window.document.theForm.userProf.value)";>
</td>
</tr>
</TABLE>
</FORM>
</BODY>
</HTML>
           
       



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Language Basics
» String