Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

multiple submit button form to multiple php files

<script type="text/javascript">
  function submitForm(action) {
    var form = document.getElementById('form1');
    form.action = action;
    form.submit();
  }
</script>

...

<form id="form1">
  <!-- ... -->
  <input type="button" onclick="submitForm('page1.php')" value="submit 1" />
  <input type="button" onclick="submitForm('page2.php')" value="submit 2" />
</form>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #multiple #submit #button #form #multiple #php #files
ADD COMMENT
Topic
Name
5+5 =