Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

Online Javascript Editor

<html>  
   <head>
      <title>The Request</title>      
      <script type = "text/javascript">
         <!--
            // Form validation code will come here.
         //-->
      </script>      
   </head>
   
   <body>
       <h1>The Request</h1>
      
      <form action = "/cgi-bin/test.cgi" name = "myForm" onsubmit = "return(validate());">
         <table cellspacing = "2" cellpadding = "2" border = "1">
            
            <tr>
               <td align = "right">Id</td>
               <td><input type = "number" name = "Id" /></td>
            </tr>
            
            <tr>
               <td align = "right">Course Number</td>
               <td><input type = "number" name = "CourseNumber" /></td>
            </tr>
            
            <tr>
               <td align = "right">Description</td>
               <td><input type = "text" name = "Description" /></td>
            </tr>
            
           <tr>
                

               <script>
                 
               </script>
               <td align = "right">Distance Education</td>
               
               <td>
        <label><input id="my-checkbox" type="checkbox" value=+50 onclick="onToggle()"> </label></td>
            </tr>
            
            
            <tr>
               <td align = "right">Additional Marks</td>
               <td><input type = "number" name = "AddMarks" /></td>
            </tr>
            
         </table>
      </form>
      
      
      <p>
                     <td align = "right">Number of Courses</td>
               <td><input type = "number" name = "NumberCourses" id = "NumCourses"/></td>
            <script type="text/javascript"> 
document.getElementById("NumCourses").value = 0
</script>

 <td align = "right">Total Cost</td>
               <td><input type="text" id="total" name ="total" value="0.0"></td>
</script></p>

<b>Reasons: </b><input type="radio" name="reason" value="Doctor"> Doctor's Note
<input type="radio" name="reason" value="LackWork"> Lack of Work
<input type="radio" name="reason" value="Compassion"> Some Compassion


      <p><td>
          <br>
          <input type = "submit" value = "Go For It" />
          <input type = "reset" value = "Clear and Reset" /></td>
       <td align = "right"></td>
               <td>
                  <select name = "Use">
                     <option value = "-40" selected>First Time User</option>
                     <option value = "1">Frequent Flyer</option>
                     <option value = "2">Buying a Degree</option>
                  </select>
</div>
          
          </p>
          
          <p><h4>Summary of Your Request(s)</h3>
      <p><textarea rows="6" cols="60">

</textarea></p>

<p><h4>Danger Range</h3>
      <p><textarea rows="6" cols="60">

</textarea></p>
 
   <script>
  // on toggle method
  // to check status of checkbox
  function onToggle() {
    // check if checkbox is checked
    if (document.querySelector('#my-checkbox').checked) {
      // if checked
      console.log('checked');
    } else {
      // if unchecked
      console.log('unchecked');
    }
  }

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.