Set the action of the form to the same page, then when you want to submit to
a different page, change the action. As someone has said, formName.action is
the attriubute you want to change.

<form name="theForm" action="form.cfm" method="post">

        <select name="theSelect" onchange="document.theForm.submit();">
                <option value="1">1</option>
                <option value="2">2</option>
                <option value="3">3</option>
                <option value="4">4</option>
        </select>

         <input type="button" value="Search"
onClick="document.theForm.action='anotherpage.cfm';
document.theForm.submit();">


</form>

This seems to work unless I'm missing something.

Ade


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: 27 May 2004 09:15
To: [EMAIL PROTECTED]
Subject: Re: [ cf-dev ] Argghghhghghgg!!



Hello again all.

Duncan. I have just tried that Javascript thingy you posted but it still
posts back to the original form ... :(

Sorry to be a pain about this but I javascript really leaves me cold with
its this.that.theother stuff and I really appreciate the help.

The form should do this ...

User selects a menu type (form post back to itself)
User selects a relative Phase (form post back to itself)
User selects a relative Group

User clicks the Search button

Form variables now passed to modrep_results.cfm

This is what I have ...

<table border="0" width="100%" cellspacing=4 cellpadding=6>
      <form name="DropDown" method="post">
            <cfquery name="get_Menu" datasource="webuserDSN">
            SELECT menu_id, menu_name
            FROM menus
            </cfquery>
            <!---  Select Menu Type--->
            <tr>
                  <td colspan="3" valign="top" align="left">
                        <font face="arial, Arial, Helvetica">
                        <font size="2">
                        <font color="#000080"><b>Please select which menu
the report to modify is under.</b><br>
                        </font>
                        <font face="arial, Arial, Helvetica">
                        <font size="2">
                        This is the menu from the default screen on the
performance website.
                        <p>
                        <cfoutput>
                              <select name="selected_menu" required="yes"
onchange="this.form.submit()">
                                    <option value="">Select Menu</option>
                              <cfloop query="get_Menu">
                                    <option value="#menu_id#" <cfif
isDefined('form.selected_menu')><cfif form.selected_menu eq
"#menu_id#">selected</cfif></cfif>>#menu_name#</option>
                              </cfloop>
                              </select>
                        </cfoutput>
                        </font>
                  </td>
            </tr>
            <!---  Select Phase Type--->
            <cfif isDefined('page.selected_menu')>
                  <!--- query DB for second drop down list, based on the
selected item from the first list --->
                  <cfquery name="get_phase" datasource="webuserDSN">
                  SELECT DISTINCT phases.phase_id, phases.phase,
details.menu_group
                  FROM details
                        INNER JOIN phases ON details.phase_id =
phases.phase_id
                  WHERE menu_group = #page.selected_Menu#
                  </cfquery>
                  <tr>
                        <td colspan="3" valign="top" align="left">
                              <font face="arial, Arial, Helvetica">
                              <font size="2">
                              <font color="#000080"><b>Please select the
Phase which the report relates to.</b>
                              </font>
                              <p>
                              <cfoutput>
                                    <select name="selected_Phase"
required="yes" onchange="this.form.submit()">
                                          <option value="">Select
Phase</option>
                                          <cfloop query="get_Phase">
                                                <option value="#phase_id#"
<cfif isDefined('form.selected_phase')><cfif form.selected_phase eq
"#phase_id#">selected</cfif></cfif>>#phase#</option>
                                          </cfloop>
                                    </select>
                              </cfoutput>
                              </font>
                        </td>
                  </tr>
            </cfif>
            <!---  Select Group Type--->
            <cfif isDefined('page.selected_phase')>
                  <cfquery name="get_group" datasource="webuserDSN">
                  SELECT DISTINCT details.menu_group,
report_groups.report_group, report_groups.group_id, details.phase_id
                  FROM details
                        INNER JOIN report_groups ON details.group_id =
report_groups.group_id
                  WHERE (details.menu_group = #page.selected_Menu# ) AND
(details.phase_id = #page.selected_phase#)
                        ORDER BY report_groups.report_group ASC
                  </cfquery>
                  <tr>
                        <td colspan="3" valign="top" align="left">
                              <font face="arial, Arial, Helvetica">
                              <font size="2">
                              <font color="#000080"><b>Please select the
Group the report is in.</b><br>
                              </font>
                              <p>
                              <cfoutput>
                                    <select name="selected_group"
required="yes">
                                          <option value="">Select
Group</option>
                                          <cfloop query="get_group">
                                          <option
value="#group_id#">#report_group#</option>
                                          </cfloop>
                                    </select>
                              </cfoutput>
                              </font>
                        </td>
                  </tr>
            </cfif>
</table>

<!--- END COLDFUSION INSERT --->


                                    </td>
                      </tr>
                    </table><!--mstheme--><font face="arial, Arial,
Helvetica"><!--mstheme--></font></td>
                    <td valign="top" align="left" height="110"
width="8"><!--mstheme--><font face="arial, Arial,
Helvetica"><!--mstheme--></font></td>
                    <td valign="top" align="left" height="110"
width="4"><!--mstheme--><font face="arial, Arial, Helvetica"><img
                      border="0" src="images/boxside.gif" width="4"
height="110"><!--mstheme--></font></td>
                  </tr>
                  <tr>
                    <td valign="top" align="left" height="12" width="580"
                    colspan="5"><!--mstheme--><font face="arial, Arial,
Helvetica"><img border="0" src="images/botmlinw.gif" width="580"
height="12"><!--mstheme--></font></td>
                  </tr>
                </table>
                              <p></p>
                                    <input type="button" value="Search"
onClick="document.DropDown.action.value='modrep_results.cfm';document.DropDo
wn.submit()">
                                    </form>





****************************************************************************
*********************
The information contained within this e-mail (and any attachment) sent by
Birmingham City Council is confidential and may be legally privileged. It is
intended only for the named recipient or entity to whom it is addressed. If
you are not the intended recipient please accept our apologies and notify
the sender immediately, or telephone +(44) 121 303 6666. Unauthorised
access, use, disclosure, storage or copying is not permitted and may be
unlawful. Any e-mail including its content may be monitored and used by
Birmingham City Council for reasons of security and for monitoring internal
compliance with the office policy on staff use. E-mail blocking software may
also be used. Any views or opinions presented are solely those of the
originator and do not necessarily represent those of Birmingham City
Council. We cannot guarantee that this message or any attachment is virus
free or has not been intercepted and amended.

****************************************************************************
*********************


--
These lists are syncronised with the CFDeveloper forum at
http://forum.cfdeveloper.co.uk/
Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided
by activepdf.com*
      *Forums provided by fusetalk.com* :: *ProWorkFlow provided by
proworkflow.com*
           *Tutorials provided by helmguru.com* :: *Lists hosted by
gradwell.com*

To unsubscribe, e-mail: [EMAIL PROTECTED]


-- 
These lists are syncronised with the CFDeveloper forum at 
http://forum.cfdeveloper.co.uk/
Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
 
CFDeveloper Sponsors and contributors:-
*Hosting and support provided by CFMXhosting.co.uk* :: *ActivePDF provided by 
activepdf.com*
      *Forums provided by fusetalk.com* :: *ProWorkFlow provided by proworkflow.com*
           *Tutorials provided by helmguru.com* :: *Lists hosted by gradwell.com*

To unsubscribe, e-mail: [EMAIL PROTECTED]

Reply via email to