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!

Request.Form question

Status
Not open for further replies.

sabavno

Programmer
Jul 25, 2002
381
CA
Hi,

On my form I have 2 drop-down box:
<SELECT ID=&quot;DisplayBy&quot; onChange=&quot;ChangeValues()&quot;>

<OPTION value=&quot;Charges&quot;
>Charges</OPTION>
<OPTION value=&quot;Count&quot;

>Count</OPTION>

</SELECT>


<SELECT NAME=Years>
<OPTION value=&quot;2001&quot;>2001</OPTION>
<OPTION value=&quot;2002&quot;
<% if (Year(Date) = &quot;2002&quot;) then
response.write(&quot;SELECTED&quot;)
end if
%>
>2002</OPTION>
<OPTION value=&quot;2003&quot;
<% if (Year(Date) = &quot;2003&quot;) then
response.write(&quot;SELECTED&quot;)
end if
%>
>2003</OPTION>
</SELECT>


When I submit values and try to retrieve them I have this:

year=Request.Form(&quot;years&quot;)
display=Request.Form(&quot;DisplayBy&quot;)

I am able to retrieve &quot;years&quot;, but not &quot;DispalyBy&quot;
I suspect it is because I have NAME property for &quot;years&quot; combo box, and ID for &quot;DisplayBy&quot;.

Please help.

Thanks

 

u suspect right

try this:
<SELECT ID=&quot;DisplayBy&quot; name=&quot;DisplayBy&quot; onChange=&quot;ChangeValues()&quot;>
 
yes it is due to the name being absent in the first select. you must specify a name for the form to pass the parameter. you may have both with in the input field if you are using ID for validation or other dynamic reasons A language that doesn't affect the way you think about programming is not worth knowing.
admin@onpntwebdesigns.com
 
Hi ...
you are right.
you can use ID for the client side and javascripts but you have to use name for the object when you want to submit the form.
so you can use this :
<SELECT ID=&quot;DisplayBy&quot; name=&quot;DisplayBy&quot; onChange=&quot;ChangeValues()&quot;>
----
TNX.
E.T.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top