Don't know if this is the best, but as follows is example code for the way I do it.

Part of form with multiple submit buttons on it follows:

<CFFORM NAME="SHP_OPTS" ACTION="SHP_OPTS.CFM">

    <INPUT TYPE="submit" NAME="SHP_DTL" VALUE="< View Detail">
       &nbsp;
    <INPUT TYPE="submit" NAME="SHP_ED"  VALUE="< Edit Detail">
       &nbsp;
    <INPUT TYPE="submit" NAME="SHP_DEL" VALUE="< Delete">

    <INPUT TYPE="submit" NAME="SHP_NEW" VALUE="Add Shipment Record">

</CFFORM>


Form called by the form with the submit buttons on it follows:
Should have used CFSWITCH instead of the nested CFIFs, but it started with only two 
buttons and grew to four and I got lazy.

<!--------------------------------------
PROG: SHP_OPTS.CFM
WHAT: Selects form based on which submit
      button was clicked in SHP_DSP.CFM
---------------------------------------->

<HTML>

  <CFIF isdefined("SHP_DTL")>
    <CFINCLUDE TEMPLATE="SHP_DSP.CFM">
  <CFELSE>
    <CFIF isdefined("SHP_ED")>
      <CFINCLUDE TEMPLATE="SHP_ED.CFM">
    <CFELSE>
      <CFIF isdefined("SHP_DEL")>
        <CFINCLUDE TEMPLATE="SHP_DEL.CFM">
      <CFELSE>
        <CFINCLUDE TEMPLATE="SHP_NEW.CFM">
      </CFIF>
    </CFIF>
  </CFIF>

</HTML>

Hope this helps

     ^
    / \__
   (    @\___
  /          O
 /    (_____/
/_____/
Whoof...
410-757-3487

-----Original Message-----
From:   Les Irvin [SMTP:[EMAIL PROTECTED]]
Sent:   Tuesday, February 20, 2001 10:15 PM
To:     CF-Talk
Subject:        Multiple submit buttons on a form

How would one put multiple submit buttons on a single form, each calling a 
different page upon submit?
Thanks,
Les
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to