Using Status Messages : StatusBar « Window Browser « JavaScript DHTML






Using Status Messages


<html>
<head>
<title>JavaScript Unleashed</title>
<script language= "JavaScript">
<!--
function statusMsg(msgType) {
   var message = "";
   if(msgType == "string") {
      message = "string";
   }
   if(msgType == "integer") {
      message = "integer";
   }
   else if(msgType == "dollar") {
      message = "dollar and float";
   }

   else if(msgType == "credit") {
      message = "credit number";
   }
   window.defaultStatus = message;
   window.status = message;
}
//-->
</script>
</head>
<body onFocus="statusMsg('')">
<form name="form1" action="#" method="post">
<br>First Name <input type="text" size=20 maxlength=20 name="Integer" onFocus="statusMsg('string')"><br>
 Last Name <input type="text" size=20 maxlength=20 name="Integer" onFocus="statusMsg('string')"><br>
Age <input type="text" size=5 maxlength=5 name="Integer" onFocus="statusMsg('integer')"><br>
Amount <input type="text" size=6 maxlength=6 name="Dollar" onFocus="statusMsg('dollar')"><br>
Card # <input type="text" size=16 maxlength=16 name="Credit" onFocus="statusMsg('credit')"><br>
<br>
<input type="submit" value="Submit">
</form>
</body>
</html>
           
       








Related examples in the same category

1.Date in the status bar
2.Displays the time in the status line
3.Write text to the window's status bar
4.Using the self Property in status bar
5.Setting the Default Status Message
6.Links with Custom Statusbar Messages
7.Handling Status Message Changes
8.JavaScript display infomation in Status Bar
9.Working with Status Bar Messages
10.Scrolling Text in the Status Window
11.The onFocus event Handler
12. Creating a Scrolling Banner in status bar