Page 1 of 1

Multple submit button option with POST method

Posted: Fri Aug 22, 2003 4:18 pm
by szms
Hi there..

I am trying to implement a form and two subnit button(yea and no) using POST method. If I prss "yes" button it will open a new page yes.html and display whatever is selcted from the form. And for "no" button it will open no.html and display the selected contents. How to do that?

Re: Multple submit button option with POST method

Posted: Fri Aug 22, 2003 4:25 pm
by ericsodt
<HTML>
<FORM name="myform" action="go.php" Method="post">
<input type="hidden" value="" name="Y_N" id="Y_N">
<TABLE>
<TR>
<TD><INPUT TYPE="button" value="yes" id="yes" onclick="document.myform.yes.value='yes'"></TD>
<TD><INPUT TYPE="button" value="no" id="no" onclick="document.myform.yes.value='no></TD>
</TR>
</TABLE>
</HTML>



The page passes the hidden element Y_N and the javascript changes its value. At go.php, you can decide what you want to do with logic....

Hope this helps


szms wrote:Hi there..

I am trying to implement a form and two subnit button(yea and no) using POST method. If I prss "yes" button it will open a new page yes.html and display whatever is selcted from the form. And for "no" button it will open no.html and display the selected contents. How to do that?