Katz, Dov B (IT) wrote:

> 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>

Huh? That's overkill, isn't it? Why not just have two fields:

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

And in your index.cfm file:

<cfif IsDefined("FORM.faSuffix")>
     <cfset FORM.fuseaction = FORM.fuseaction & "." & FORM.faSuffix>
</cfif>

Simpler, no? You're leaving it more accessible, and it's less likely to
screw up in some way.

K.

-- 
Keith Gaughan, Developer
Digital Crew Ltd., Pembroke House, Pembroke Street, Cork, Ireland
http://digital-crew.com/

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Find out how CFTicket can increase your company's customer support 
efficiency by 100%
http://www.houseoffusion.com/banners/view.cfm?bannerid=49

Message: http://www.houseoffusion.com/lists.cfm/link=i:4:190119
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=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to