The advantage of using named submit buttons, is that you can have multiple
actions on the same form.
And it's good to keep in mind if the user presses the enter key to submit
the form, instead of pressing the submit button(s), browsers behave different.
The explicit nature of naming stuff makes it easier to maintain, theoretically.
Usually I'll have a <cfif structKeyExists(form,'fieldnames')> followed by a
<cfif structKeyExists(form,"saveRecord")>, saveRecord being the name
of the save button. There may be a "deleteRecord" or some such button
too.
But I like knowing that the user clicked a specific button.
And later on, I may end up putting forms together or something, and it
helps when debugging to see names of things.
Even if I just have one submit, I name it. Probably because of my
main style of coding more than anything else; I can envision designs
where it wouldn't make much difference, I reckon...
On 9/21/06, Bobby Hartsfield <[EMAIL PROTECTED]> wrote:
> How you include the action is of course up to you. CFC, Custom Tag, straight
> code, sending it to billy bob's remote service... etc, etc...
>
> The point of using isdefined over http.request method is rather moot since
> it's only necessary to use something else when you have more than one form
> on the page. Even then, I'd use both to decide if a form was submitted and
> which one it was. I prefer not to check for buttons by name to decide which
> action the person wants to take; as a matter of fact... I avoid using more
> than one submit BUTTON as much as possible ;-)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:253808
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4