RE: CFinput submit Action page... oh great...

2006-09-22 Thread Bobby Hartsfield
I didn’t say I didn't know the possibilities, I just said I didn’t use them
if at all possible (which I can't think of case where it wouldn't be
possible). I also didn't say I DIDN'T name buttons... (I name everything and
give an ID to everything) I just said they weren't what I checked for to
decide whether or not a form was submitted. Besides, what 'multiple' actions
usually happen on a form? Add / Edit / Delete a record? Add only shows on a
blank form that is ready to take data for addition to the database. Edit
only shows on a form that is pre-populated with a specific record, delete
doesn't need to use form at all. 

I explained recently how I handle a 'preview' action and it sure wasn't a
preview submit button ;-) 

A 'copy' action can easily be achieved by altering the 1 little thing that
differentiates between an 'Edit' and an 'Add' form... a hidden record ID
field.

Since the button always says 'Save' with a small floppy icon on or near
it... it doesn't change and doesn't matter what the action is.

So... with a checkbox next to the 'Save' button that says 'Save As Copy',
you can either update, or add a new record. But it's multiple actions with
one button.


-Original Message-
From: Denny Valliant [mailto:[EMAIL PROTECTED] 
Sent: Friday, September 22, 2006 2:08 AM
To: CF-Talk
Subject: Re: CFinput submit Action page

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:253834
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4


Re: CFinput submit Action page... oh great...

2006-09-22 Thread Denny Valliant
Yeah, I read more into your reply than was there, sorry for implying
anything.

Whether you use form or URL variables, I'm sure you check for them
in a way that makes sense.

I like explicit logic, is what I was trying to say.

In some of my forms I'll have both a Save and a Delete button.
Sometimes a button makes more sense than a URL.

I also have forms with sub-forms, and I like to save the info on
the main form before shunting the user on off to the sub-form.

Usually in that case I'll use a hidden field named softSave or some
such, and check for its existence, even though I guess I could
just check for form.fieldnames or whatnot.

I am liking the user experience way better with things like AJAX
and tabbed UIs though, so button actions are gonna get relegated
to those sites that need to support the really crappy browsers.

Again, apologies for coming off so preachy Bobby!
=|]3|\|

On 9/22/06, Bobby Hartsfield [EMAIL PROTECTED] wrote:
 I didn't say I didn't know the possibilities, I just said I didn't use them
 if at all possible (which I can't think of case where it wouldn't be
 possible). I also didn't say I DIDN'T name buttons... (I name everything and
 give an ID to everything) I just said they weren't what I checked for to
 decide whether or not a form was submitted. Besides, what 'multiple' actions
 usually happen on a form? Add / Edit / Delete a record? Add only shows on a
 blank form that is ready to take data for addition to the database. Edit
 only shows on a form that is pre-populated with a specific record, delete
 doesn't need to use form at all.

 I explained recently how I handle a 'preview' action and it sure wasn't a
 preview submit button ;-)

 A 'copy' action can easily be achieved by altering the 1 little thing that
 differentiates between an 'Edit' and an 'Add' form... a hidden record ID
 field.

 Since the button always says 'Save' with a small floppy icon on or near
 it... it doesn't change and doesn't matter what the action is.

 So... with a checkbox next to the 'Save' button that says 'Save As Copy',
 you can either update, or add a new record. But it's multiple actions with
 one button.


 -Original Message-
 From: Denny Valliant [mailto:[EMAIL PROTECTED]
 Sent: Friday, September 22, 2006 2:08 AM
 To: CF-Talk
 Subject: Re: CFinput submit Action page

 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:253947
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4