Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFFORM submit to 2 different action pages

Status
Not open for further replies.

skeutzer

Programmer
Sep 26, 2000
3
US
I'm trying to write a form that will either submit to itself or to another action page, depending on which button is clicked.

I have a text box, with an "Accept" (Submit) button which in turn runs a query to populate a SELECT control on the same page (based on what was entered in the text box). To do this I'm trying to have the CFFORM action tag submitting to the same page

After both the text box and the select form are entered/chosen, then the user would click another Submit button to go to the action page, which is a different page.

I can either have the page submit to itself or submit to another action page, but I can't make ColdFusion figure out which page I'm submitting to. If ColdFusion can't do this, can it be done using some JavaScript inside ColdFusion? [sig][/sig]
 
kman,

Are you trying to put two SUBMIT buttons at the bottom of a page? Bad idea. Try figuring out whether it is the value in the text box that will determine where the value should go; or is it the user's choice, then use another type of button. SUBMIT behind the scenes based on that value.

Can you use frames to separate the outputs?

Lets say you have the text box on the far left, and a single target frame on the right. You accept the value in any case to a hidden form variable.

If the user chooses the button that runs the query to populate the select box,
1) the value is passed into the form as a hidden variable and
2) the value is passed to the action page which
3) populates the SELECT box on the target frame.

SUBMIT from the target frame allows you to do what you want with all values and selections from there.



[sig][/sig]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top