Mega Code Archive

 
Categories / JavaScript DHTML / Form Control
 

Adjusting a Server Submission Action

<html>  <head>  <title>Checkbox Submission</title>  <script type="text/javascript">  function setAction(form) {           if (form.checkThis.checked) {          form.action = form.checkThis.value;      } else {          form.action = "file://primaryURL";      }      return true;  }  </script>  </head>  <body>  <form method="POST" action="">  <input type="checkbox" name="checkThis" value="file://alternateURL" />Use alternate  <input type="submit" name="boxChecker" onclick="return setAction(this.form)"/> </form>  </body>  </html>