House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

retreive the FORM name?

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Hi,
Claude Schneegans
05/21/04 11:58 A
Try this, just a thought.
Bryan F. Hogan
05/21/04 12:11 P
>>Try this, just a thought.
Claude Schneegans
05/21/04 12:35 P
Claude,
Guy Rish
05/21/04 12:12 P
At 02:32 PM 5/21/2004, you wrote:
Alexander Sherwood
05/21/04 02:34 P
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Claude Schneegans
05/21/2004 11:58 AM

Hi, Any one knows if it is possible to retreive the form name from the template fired by a form? -- _______________________________________ See some cool custom tags here: http://www.contentbox.com/claude/customtags/tagstore.cfm Please send any spam to this address: piegeacon@internetique.com Thanks.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Charlie Griefer
05/21/2004 12:08 PM

not via CF.  you'd need to put it in a hidden form field. just out of curiousity...why would you need the form name? > Hi, > > Any one knows if it is possible to retreive the form name from the template fired by a form? ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bryan F. Hogan
05/21/2004 12:11 PM

Try this, just a thought. <cfif isDefined('form.submit')>   <cfdump var="#form#"> </cfif> <script> function checkForm(theForm)  { document.forms[theForm.name].theFormsName.value=theForm.name; return true; } </script> <form action="test.cfm" method="post" name="formName" onsubmit="return checkForm(this)"> <input type="hidden" name="theFormsName" value=""> <input type="submit" name="submit" value="submit"> </form> Claude Schneegans wrote: > Any one knows if it is possible to retreive the form name from the > template fired by a form?

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Claude Schneegans
05/21/2004 12:35 PM

>>Try this, just a thought. Ok, but it is precisely what I'm looking a simpler solution for. -- _______________________________________ See some cool custom tags here: http://www.contentbox.com/claude/customtags/tagstore.cfm Please send any spam to this address: piegeacon@internetique.com Thanks.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Guy Rish
05/21/2004 12:12 PM

Claude, Since only one form can post per request it is presumed that you will know because of the form's linkage to the ACTION.   If you are using one uber ACTION handler then create a hidden INPUT that contains the name of the form.  This can lead to problems though and it not the better choice.  If your uber ACTION handler is handling so much stuff that such a thing matters then you should consider breaking it out into multiple templates. rish Hi, Any one knows if it is possible to retreive the form name from the template fired by a form? -- _______________________________________ See some cool custom tags here: http://www.contentbox.com/claude/customtags/tagstore.cfm Please send any spam to this address: piegeacon@internetique.com Thanks.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Claude Schneegans
05/21/2004 12:33 PM

>>Since only one form can post per request it is presumed that you will know because of the form's Sure, but a template can contain several forms which all call the same template, even if only one is submitted. My question is then to detect the one that fired the template. -- _______________________________________ See some cool custom tags here: http://www.contentbox.com/claude/customtags/tagstore.cfm Please send any spam to this address: piegeacon@internetique.com Thanks.

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
GFSCold
05/21/2004 12:38 PM

What if you give the submit buttons unique names.  That way you can check which form you are processing by the name of the submit button that was pressed. Jim Audette Website Administrator Garrison Forest School 300 Garrison Forest Road Owings Mills, MD 21117 jim_audette@gfs.org 410-559-3128

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
05/21/2004 01:18 PM

> Any one knows if it is possible to retreive the form name > from the template fired by a form? No, that isn't passed to the server when the form is submitted. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ phone: 202-797-5496 fax: 202-797-5444

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Dave Watts
05/21/2004 02:27 PM

> Sure, but a template can contain several forms which > all call the same template, even if only one is submitted. > My question is then to detect the one that fired the > template. You will then need to send additional information within the form itself. Alternatively, you could simply build a single form, and simply respond to the form variables you receive within your action page. Dave Watts, CTO, Fig Leaf Software http://www.figleaf.com/ phone: 202-797-5496 fax: 202-797-5444

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Alexander Sherwood
05/21/2004 02:34 PM

At 02:32 PM 5/21/2004, you wrote: ----- Excess quoted text cut - see Original Post for more ----- You could also FUSEBOXIFY the form and bury the form name in .DSP and .QRY files nested 8-10 levels deep amd call its FUSEACTION.... ;-) Seriously, if you have several forms, why not add a hidden form field in each form with the name of the form as the value? Then your action page could look at the one hidden field, grab its value and then know what form was submitted? Hope this helps. ----- Excess quoted text cut - see Original Post for more ----- ---------------------------------- Alex Sherwood PHS Collection Agency THE COLLECTORS P:   813-283-4579 F:   301.664.6834 W: www.phs-net.com


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

February 09, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29