How to insert default value if text box is empty

 <html>  
 <head>  
 <script>  
 function setDefaults(){  
   if(document.form.myTextBox.value==""){  
     document.form.myTextBox.value = "default value";  
   }  
 }  
 </script>  
 </head>  
 <body onLoad="setDefaults();">  
 </body>  
 </html>  
How to insert default value if text box is empty How to insert default value if text box is empty Reviewed by Unknown on 11:16 AM Rating: 5

No comments:

Powered by Blogger.