Debt Consolidation - Find jobs - Credit Reports - Debt Consolidation - Communications Technology Articles

PDA

View Full Version : Problem with dynamically assigning FORM value


dul3728
Oct 25th 2006, 11:56 am
Hello everyone,

I am trying to pass some coldfusion variables through a form to a different cfm page.

<cfset tName = "#form.taskName#">
<cfset sBy = "#form.submittedBy#">

<form name="emailback" action="emailFB.cfm" method="post">
<input type="hidden" name="tNameC" value= "#tName#">
<input type="hidden" name="sByC" value="#sBy#">
<input name="submitQ" type="submit" value="Submit Job"></form>

On the emailFB.cfm page:

<cfoutput><strong>Task:</strong> #form.tNameC#</cfoutput> <br/>
<cfoutput><strong>Submitted by:</strong> #form.sByC#</cfoutput> <br/>

Output on the emailFB.cfm page is:

Task: #tName#
Submitted by: #sBy#

Can somebody please tell me how I can pass the value in form.taskName and form.submittedBy to emailFB.cfm page.

Thanks a lot in advance,

dulc.

dul3728
Oct 26th 2006, 8:48 am
Thanks everyone.... got the solution from a different forum.

The first page should look like THIS to work...

<cfset tName = form.taskName> <!--- No quotes and no octothorpes. --->
<cfset sBy = form.submittedBy>

<CFOUTPUT> <!--- Need this for variables to "print" to the form fields. --->
<form name="emailback" action="emailFB.cfm" method="post">
<input type="hidden" name="tNameC" value= "#tName#">
<input type="hidden" name="sByC" value="#sBy#">
<input name="submitQ" type="submit" value="Submit Job"></form>
</CFOUTPUT>


dul.

datropics
Oct 26th 2006, 10:01 am
or instead of putting CFoutput around the entire form, use cfform and cfinput instead of form and input