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

Passing variables 1

Status
Not open for further replies.

MarcHav

Technical User
May 30, 2002
12
FR
Can somebody help me see my mistake ?
The patches display in the drop down list but the PatchID stays empty in the passing URL !
************************************************************
sql_request = "TRANSFORM Count(PatchList.PatchDesc) AS [The Value] SELECT PatchList.PatchName, Count(PatchList.PatchDesc) AS [Total Of PatchDesc] FROM PatchList GROUP BY PatchList.PatchName PIVOT PatchList.SUSServer"

rcd.open sql_request, cnx
%>
<form name=&quot;frmSelect&quot; method=&quot;Post&quot; target=&quot;_blank&quot; action=&quot;../LocalServer/AUPatchDetails.asp?PatchID=&quot; &quot;&quot; & rcd(&quot;PatchName&quot;) &&quot;&quot;>
<SELECT name=Patches LANGUAGE=javascript onchange=&quot;return dept_onchange(frmSelect)&quot;>
<%
Do while not rcd.EOF
if Request.Form(&quot;Patches&quot;) = rcd(&quot;PatchName&quot;) then 'if this is the selected one then display as selected
Response.Write &quot;<OPTION VALUE = '&quot; & rcd (&quot;PatchName&quot;) & &quot;' SELECTED>&quot;
Response.Write rcd(&quot;PatchName&quot;) & &quot;</Option>&quot;
Response.Write rcd(&quot;PatchName&quot;)
rcd.MoveNext
else
Response.Write &quot;<OPTION VALUE = '&quot; & rcd (&quot;PatchName&quot;) & &quot;'>&quot;
Response.Write rcd(&quot;PatchName&quot;) & &quot;</Option>&quot;
rcd.MoveNext
end if
loop
%>
</SELECT>
</form>
************************************************************
Thanks in advance for the help.
 
I think this might be because you are trying to put it on the querystring which is in an action attribute.

Try....

<form name=&quot;frmSelect&quot; method=&quot;Post&quot; target=&quot;_blank&quot; action=&quot;../LocalServer/AUPatchDetails.asp>

<input type=&quot;hidden&quot; name=&quot;PatchID&quot; value=&quot;<%=rcd(&quot;PatchName&quot;)%>&quot;>
 
Yes, that helped !
Of course the problem I am having now is that the always the first PatchID from the drop down list is returned, no matter what I select...
Any ideas on this one ?

btw, thank you very much for your help already.
 
I think your variable names are a bit confused.

The select tag should give back a key/value of &quot;Patches=somevalue&quot;

The hidden variable is called patchID so that will bring back whatever is put in that when the page is loaded.

If you are just trying to get a drop list of items that are 'patchIDs' then simply have the drop down, call it patchID and forget the hidden variable.

This probably isnt that helpful, but it is difficult to see what it is you are trying to do.


JEz
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top