0

hi !
how can i use multiple submit buttons in the same form

i want to pass form values to different pages depending on which of the two submit button is clicked...
thank's

2
Contributors
2
Replies
3
Views
8 Years
Discussion Span
Last Post by aashishn86
0

you will need to probably use javascript for that..

alternatively... give your submit buttons diferent values and retrieve them on a "splitter" page..

request("sumbit1") etc :P

0

ya........ found a javascript code...

<SCRIPT language="JavaScript">
function OnSubmitForm()
{
  if(document.pressed == 'Insert')
  {
   document.myform.action ="insert.html";
  }
  else
  if(document.pressed == 'Update')
  {
    document.myform.action ="update.html";
  }
  return true;
}
</SCRIPT>


<FORM name="myform" onSubmit="return OnSubmitForm();">

<INPUT TYPE="SUBMIT" name="Operation" onClick="document.pressed=this.value" VALUE="Insert">

<INPUT TYPE="SUBMIT" name="Operation" onClick="document.pressed=this.value" VALUE="Update">

</FORM>
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.