Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing data between forms?? 2

Status
Not open for further replies.

SSonnier

Technical User
Nov 4, 2003
78
US
I do not see this adressed in teh forum so far.

With ASP I can do the following.

1) Pull data to a form within a page. The form would allow the user to choose a record for updating

2) The action on the page would send the user to a new form that is already populated by the values held in the prior form. The user could then update the records.

I have tried to pass the values to the new form but can not get them to display. Would someone advise the correct syntax.

this is what I've tried so far...

<td width=&quot;20%&quot;><input type=&quot;text&quot; name=&quot;last_name&quot; size=&quot;20&quot; value=&quot;#last_name#&quot;></td>
or
<td width=&quot;20%&quot;><input type=&quot;text&quot; name=&quot;last_name&quot; size=&quot;20&quot; value=&quot;#form.last_name#&quot;></td>
or
<td width=&quot;20%&quot;><input type=&quot;text&quot; name=&quot;last_name&quot; size=&quot;20&quot; value=form.last_name></td>
 
Data is transfered in the following basic ways:
[ol]
[li] Through URL via a hyperlink. The Cold Fusion URLEncodedFormat function can be used to take care of special characters, etc. Clients see [/li]
[li] Through FORM variables, method=&quot;post&quot; action=&quot;cfpage&quot; Note that you will need to use a button to invoke. All variables will be available using &quot;#Form.xxx#&quot; where xxx is your variable name. Note, in your example the cfoutput tag must be used to inform CF that variable processing should be done on the lines between the <cfoutput></cfoutput> tags [/li]
[/ol]
 
I'm trying to use option 2. How do I show the info on the second page?

Here is the form that would be passing the info
<cfoutput query=&quot;totallist&quot;>
<form action=&quot;update3.cfm&quot; method=&quot;post&quot;>
<input type=&quot;hidden&quot; name=&quot;contactnum&quot; value=&quot;#contactnum#&quot;>
<input type=&quot;hidden&quot; name=&quot;first_name&quot; value=&quot;#first_name#&quot;>

<tr width=&quot;100%&quot;<cfif currentrow mod 2 gt 0>bgcolor=&quot;cccc99&quot;</cfif>>
<td width=&quot;20%&quot;>#last_name#</td>
<td width=&quot;20%&quot;>#first_name#</td>
<td width=&quot;10%&quot;><input type=&quot;submit&quot; value=&quot;Update&quot;></td>
</form>
</tr>
</cfoutput>
 
Update3.cfm:
<cfoutput>
<form action=&quot;update3.cfm&quot; method=&quot;post&quot;>
<input type=&quot;hidden&quot; name=&quot;contactnum&quot; value=&quot;#form.contactnum#&quot;>
<input type=&quot;hidden&quot; name=&quot;first_name&quot; value=&quot;#form.first_name#&quot;>

<tr width=&quot;100%&quot; <cfif currentrow mod 2 gt 0>bgcolor=&quot;cccc99&quot;</cfif>>
<td width=&quot;20%&quot;>#form.last_name#</td>
<td width=&quot;20%&quot;>#form.first_name#</td>
<td width=&quot;10%&quot;><input type=&quot;submit&quot; value=&quot;Update&quot;></td>
</form>
</tr>
</cfoutput>
 
Thanks Steve, but how would I pass this to an input box?
In the Value of the input field?
 
Yep, just
<input type=&quot;text&quot; name=&quot;first_name&quot; value=&quot;#form.first_name#&quot;>

instead of type=&quot;hidden&quot; you'll use type=&quot;text&quot;
 
I see... I was missing the cfoutput tag on the second form

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top