This is a migrated thread and some comments may be shown as answers.

Dependent dropdown select in classic asp

0 Answers 74 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Agm
Top achievements
Rank 1
Agm asked on 22 Nov 2013, 11:21 AM
Hi,

I am using classic asp for a project.
A form with two dropdown (state and city) select and other text inputs.
I want to populate the second dropdown from database (using storeprocedure) on changing the value of first dropdown.
I am calling form.Submit() on change of state dropdown. this call populating the city dropdown by using the Request.Form("State").

But this form.Submit() call is clearing all the text inputs value.

I want to create this kind of dependent dropdown that should not clear the input text value.
Help me to achieve this.

<select name="State" onChange="this.form.action = '<%=Request.ServerVariables("Script_Name")%>'; this.form.submit();">
                    <option <%if Trim(Request.Form("EventState"))="" then Response.Write "selected" end if%> value="">          </option>
                    <option <%if Trim(Request.Form("EventState"))="AL" then Response.Write "selected" end if%> value="AL">Alabama</option>
                    <option <%if Trim(Request.Form("EventState"))="AZ" then Response.Write "selected" end if%> value="AZ">Arizona</option>
</select>


Thanking you,
AGM Raja

No answers yet. Maybe you can help?

Tags
General Discussions
Asked by
Agm
Top achievements
Rank 1
Share this question
or