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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

passing selected value of CFSELECT in an URL

Status
Not open for further replies.

2Fuzzy4U

Programmer
Dec 2, 2002
26
NL
I feel foolish, but I can't seem to figure it out.
I'm a relative newbee at CF, and have mostly been fixing problems in existing code. Now I'm building a new page and I'm stuck.

I've got a filled CFSELECT on my form and want the selected value to be passed back as an argument in my url.

This is my code (stripped a bit), all I can't figure out is how to get the correct value into URL.tranfer_To. [ponder]
I've been reading, looking, googling and trying, but just can't get it. [sadeyes] I can't help feeling I'm missing something simple.

...
...

</head>

<cfparam name="URL.action" default="">
<cfparam name="URL.user_Id" default="">
<cfparam name="URL.owner_Id" default="">
<cfparam name="URL.transfer_To" default="">

<cfset sMessage ="">

<cfif URL.action EQ 2 Or URL.action EQ 3>
<!--- Some specific coding based on the stuff passed in the URL --->

<cfset sMessage = "Right! Now for the last bit. #URL.user_Id# - #URL.owner_Id# - #URL.transfer_To#">

</cfif>

<body>

<cfform>
<cfoutput>
<cfquery name="CurrentOwner" datasource="yoonidata"> select .... </cfquery>
<cfquery name="newOwner" datasource="yoonidata"> select .... </cfquery>
<cfquery name="sql" datasource="yoonidata"> SELECT ... </cfquery>


<h3>Overzetten gebruikersbeheer</h3>
<p>#sMessage# </p>
<table>
<tr> <td width="237">#CurrentOwner.name#</td> </tr>
<tr> <td>#CurrentOwner.login_id#</td> </tr>
<tr> <td>
<cfselect name="selectOwner" style="width:255px;" query="newOwner" value="login_id" display="name">
<option value="" selected="selected">Maak een keuze</option>
</cfselect> </td>
</tr>
</table>

<table cellpadding=0 cellspacing=0 border=0>
<tr>
<td nowrap width=50><b>ID</b></td>
<td nowrap width=40>&nbsp;</td>
</tr>

<cfloop query="sql">

<tr>
<td nowrap>#user_id#</td>
<td align=right>
<a href="user_transfer.cfm?action=2&owner_Id=#owner_id#&user_Id=#user_id#&transfer_To=#Form.selectOwner#" target="mainFrame" ><img src="../../images/icon_transfer.gif"> </a>
</td>
</tr>

</cfloop>

</table>
</cfoutput>

Can somebody help me out? Please? Pretty please? [neutral]

Thanks in advance..
Coretta (NL)



__________________
Greetzzz
Coretta (NL)
 
user_transfer.cfm?action=2&owner_Id=#owner_id#&user_Id=#user_id#&transfer_To=#Form.selectOwner#

tranfer_To variable is FORM.selectOwner (your cfselect variable).

you are already passing this variable in the url to user_transfer.cfm file...

 
Sorry I've tried that, but FORM, form or Form all end up telling me

"Element SELECTOWNER is undefined in FORM"

I've seen that error while searching, so I tried defining

<cfparam name="Form.selectOwner" default="z">

It helps solving the error, but not for passing the correct value. It then always passes the value z, which makes sence. (By the way,my select is a dropdownlist, shouldn't make a difference I guess.)



__________________
Greetzzz
Coretta (NL)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top