Dependent dropdown select in classic asp

1 posts, 0 answers
  1. Agm
    Agm avatar
    26 posts
    Member since:
    Sep 2012

    Posted 22 Nov 2013 Link to this post


    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>

    Thanking you,
    AGM Raja
Back to Top