Isaac, that won't work because do tags are dealt with at parse time,
not at runtime.

You could do it like this so that you don't have to worry about
appending to the fuesaction or using the index.cfm file to figure out
what to do:

<form action="index.cfm" method="post">
<input type="hidden" name="fuseaction" value="home.formRouter">
...
<input type="submit" name="nextAction" value="Delete">
<input type="submit" name="nextAction" value="Save">
<input type="submit" name="nextAction" value="Cancel">
</form>

Then the fuseaction is like a "mini-controller" that determines which
do to call:

<fuseaction name="formRouter">
<if condition="#attributes.nextAction# eq 'Delete'">
<true><do action="home.delete"></true>
</if>
<if condition="#attributes.nextAction# eq 'Save'">
<true><do action="home.save"></true>
</if>
<if condition="#attributes.nextAction# eq 'Cancel'">
<true><do action="home.cancel"></true>
</if>
</fuseaction>

Hope that helps,

Brian

On Wed, 12 Jan 2005 13:30:54 -0500, S. Isaac Dealey <[EMAIL PROTECTED]> wrote:
> I _think_ that with Fusebox 4 and later it's possible to use a
> variable in the fuseaction in a <do> tag in your xml... so in theory
> you could simply assign the button tag a name, then parameterize the
> button name on the action page (you'd have to do this because IE
> doesn't include the button value if a user hits enter in a text field)
> and use it to process another fuseaction using the <do> verb...
> 
> in your form:
> 
> <button type="submit" name="buttonname"
>         value="save">Save</button>
> <button type="submit" name="buttonname"
>         value="delete">Delete</button>
> 
> in your circuit.xml
> 
> <fuseaction name="actMyForm">
>   <set name="attributes.buttonname"
>     value="save" overwrite="false" />
>   <do action="#attributes.buttonname#" />
> </fuseaction>
> 
> Not absolutely certain that works -- I haven't tested it, but I
> believe it does.
> 
> hth
> 
> > Hi, I have a quick fusebox question that I haven't been
> > able to find
> > an answer to yet. I have a few ideas, but I thought I'd
> > run it by some
> > people with experience. It's fusebox-specific, so I
> > apologize if it's
> > too off-topic.
> 
> > How, in fusebox, do you handle multiple submit buttons in
> > a form? For
> > example, a form that has  select, delete, and add buttons?
> > I was
> > thinking it should be submitted to an action that will
> > redirect to
> > other fuseactions depending on the button pressed (an
> > arbiter) but
> > should that be done in the circuit.xml file, or in an
> > included page?
> > If it were done in an included page, there would be the
> > problem of
> > passing the attributes along to any redirected page. If it
> > were done
> > in XML, I suppose you would use if clauses to do it, but
> > that just
> > doesn't 'feel' right to me :)
> 
> > In Mach-II, I think what I would do is have a listener
> > that would
> > check the event object for the existence of each 'action',
> > and use
> > announceEvent() to continue processing. And in good old
> > CFML,
> > obviously I'd just have an action page with if
> > (structKeyExists(form,"actionToWatchFor")) blocks.
> 
> > Any thoughts?
> 
> >
> 
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Discover CFTicket - The leading ColdFusion Help Desk and Trouble 
Ticket application

http://www.houseoffusion.com/banners/view.cfm?bannerid=48

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190164
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to