The text below is selected, press Ctrl+C to copy to your clipboard. (⌘+C on Mac) No line numbers will be copied.
Guest
Dg
By Guest on 20th February 2024 06:40:42 AM | Syntax: PYTHON | Views: 154



New Paste New paste | Download Paste Download | Toggle Line Numbers Show/Hide line no. | Copy Paste Copy text to clipboard
  1.     <html>
  2.                 <head><title>employee details</title>
  3.                         <script type="text/javascript">
  4.                                 function validate()
  5.                                 {
  6.          
  7.                                         if(document.myform.empcode.value=="")
  8.                                         {
  9.                                                 alert("Please provide your employee code!")
  10.                                                 document.myform.empcode.focus();
  11.                                                 return false;
  12.                                         }
  13.                                        
  14.                                         if(document.myform.Name.value=="")
  15.                                         {
  16.                                                 alert("Please provide your name!")
  17.                                                 document.myform.Name.focus();
  18.                                                 return false;
  19.                                         }
  20.          
  21.                                         if(document.myform.dob.value=="")
  22.                                         {
  23.                                                 alert("Please provide your dob!")
  24.                                                 document.myform.dob.focus();
  25.                                                 return false;
  26.                                         }
  27.          
  28.                                         if(document.myform.subject.value=="")
  29.                                         {
  30.                                                 alert("Please provide your gender!")
  31.                                                 document.myform.subject.focus();
  32.                                                 return false;
  33.                                         }
  34.                                        
  35.                                         if(document.myform.num.value=="")
  36.                                         {
  37.                                                 alert("Please provide your mobile no!")
  38.                                                 document.myform.dob.focus();
  39.                                                 return false;
  40.                                         }
  41.          
  42.                                        
  43.                                         if(document.myform.EMail.value=="")
  44.                                         {
  45.                                                 alert("Please provide your Email!")
  46.                                                 document.myform.EMail.focus();
  47.                                                 return false;
  48.                                         }
  49.                                         validateEmail();
  50.                                 }
  51.          
  52.                                 function validateEmail()
  53.                                 {
  54.                                         var emailID= document.myform.EMail.value;
  55.                                         atpos=emailID.indexOf("@");
  56.                                         dotpos=emailID.lastIndexOf(".");
  57.                                         if(atpos < 1 || (dotpos - atpos < 2))
  58.                                         {
  59.                                                 alert("Please enter correct email id")
  60.                                                 document.myform.EMail.focus();
  61.                                                 return false;
  62.                                         }
  63.                                         return (true);
  64.                                 }
  65.                 </script>
  66.                
  67.                 </head>
  68.                 <body>
  69.                         <h1 align="center">Employee Details</h1>
  70.                
  71.                         <form name="myform" onsubmit="return(validate())">            
  72.                
  73.                         <table borders="0" cellpadding="4" celllspacing="4">
  74.                                 <tr>
  75.                                         <th>Empcode:</th>
  76.                                         <td><input type="text" name="empcode"></td>
  77.                                 </tr>
  78.          
  79.                                 <tr>
  80.                                         <th>Name:</th>
  81.                                         <td><input type="text" name="Name"></td>
  82.                                 </tr>
  83.          
  84.                                 <tr>
  85.                                         <th>DOB:</th>
  86.                                         <td><input type="date" name="dob"></td>
  87.                                 </tr>
  88.          
  89.                                <tr>
  90.                                 <th>Gender:</th>
  91.                                 <td><input type="radio" name="subject" value="Male">Male
  92.                                 <input type="radio" name="subject" value="Female">Female</td>
  93.                         </tr>
  94.          
  95.                                 <tr>
  96.                                         <th>Mobile No:</th>
  97.                                         <td><input type="tel" size="10" name="num"></td>
  98.                                 </tr>
  99.                        
  100.                                 <tr>
  101.                                         <th>E-mail:</th>
  102.                                         <td><input type="text" name="EMail"></td>
  103.                                 </tr>
  104.                                
  105.                                 <tr>
  106.                                         <td></td><td><input type="submit" name="Submit" value="Submit"/>
  107.             <input type="reset" name="Reset" value="Reset"/></td>
  108.                         </table></form>
  109.                        
  110.                 </body>
  111.         </html>





dg