|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
retreive the FORM name?
Hi,Claude Schneegans 05/21/04 11:58 A not via CF. you'd need to put it in a hidden form field.Charlie Griefer 05/21/04 12:08 P 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 >>Since only one form can post per request it is presumed that you will knowClaude Schneegans 05/21/04 12:33 P What if you give the submit buttons unique names. That way you can checkGFSCold 05/21/04 12:38 P > Any one knows if it is possible to retreive the form nameDave Watts 05/21/04 01:18 P > Sure, but a template can contain several forms whichDave Watts 05/21/04 02:27 P At 02:32 PM 5/21/2004, you wrote:Alexander Sherwood 05/21/04 02:34 P 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. 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 ----- 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? >>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. 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. >>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. 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 > 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 > 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 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
|
February 09, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||