|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
retreive the FORM name?
Author: Alexander Sherwood
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32690#164014
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
Author: Dave Watts
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32690#164007
> 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
Author: Dave Watts
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32690#163987
> 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
Author: GFSCold
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32690#163981
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
Author: Claude Schneegans
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32690#163978
>>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.
Author: Claude Schneegans
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32690#163975
>>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.
Author: Guy Rish
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32690#163972
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.
Author: Bryan F. Hogan
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32690#163970
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?
Author: Charlie Griefer
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32690#163968
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 -----
Author: Claude Schneegans
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:32690#163966
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.
|
May 24, 2012
|
Latest Fusion Authority Articles
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||