Page 1 of 1

a form Post to many page

Posted: Thu Mar 06, 2003 6:47 pm
by valen53
hi everybody,
i have a webpage contain few button there. one of the button click for post to self page to add data to the table. another button is submit to database then jump next page. But a page only contain a form, how i post to self page and also another page ??
Beside using if (), another method to be done?
Thank you

Posted: Thu Mar 06, 2003 8:48 pm
by Stoker
HTML in itself can't handle such, I don't know if javascript can...

one way would be to post to a script here you use curl to post to other pages/sites..

Posted: Thu Mar 06, 2003 9:02 pm
by daven
This should do it. Cheers

Code: Select all

<script language="javascript">
function SubmitThis(ButtonName)&#123;
  switch(ButtonName)&#123;
    case 'A':
      document.myform.action="pageA.php"
      document.myform.submit;
      break;
    case 'B':
      document.myform.action="pageB.php"
      document.myform.submit;
      break;
  &#125;
&#125;
</script>

<form name="myform" action="">
<input type="button" name="A" value="Submit To Page A" onclick="SubmitThis(this.name)">
<input type="button" name="B" value="Submit To Page B" onclick="SubmitThis(this.name)">
</form>