You can make the button be the fuseaction field (only clicked one is
sent), but sometimes you want a prefix.suffix style fuseaction... In
that case you can do something like this:

<script language="JavaScript">
        function appendFA(fa){
                document.forms.RealForm.fuseaction.value+="."+fa;
                document.forms.RealForm.submit();
                return false;
        }
</script>
<form name="RealForm" action="index.cfm">
.....
<input type="hidden" name="fuseaction" value="someFuseactionPrefix">
.....

<input type="submit" value="Delete" onClick="return
appendFA('Delete');">
        <input type="submit" value="Save" onClick="return
appendFA('Save');">
        <input type="submit" value="Cancel" onClick="return
appendFA('Cancel');">

</form>

Just ideas...

d
-----Original Message-----
From: Ken Dunnington [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, January 12, 2005 12:54 PM
To: CF-Talk
Subject: Multiple submit buttons and Fusebox

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?



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Purchase Contribute 3 from House of Fusion, a Macromedia Authorized Affiliate 
and support the CF community.
http://www.houseoffusion.com/banners/view.cfm?bannerid=53

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190116
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