ASP/jQuery select dynamique
Voilà j'ai un problème en ASP/jQuery, j'aimerais avoir une liste dynamique. En gros quand je sélectionne un élément de mon premier Select, j'aimerais que le suivant change en fonction de l'id du premier select.
vous allez mieux comprendre avec mon code:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
<div class="acces">
<legend>Type d'accès: </legend>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="selectbasic">Type</label>
<div class="col-md-4">
<select name="acc_id_type" class="form-control type">
<% req = "SELECT typ_id, typ_libelle FROM types_acces ORDER BY typ_libelle;"
ors.open req, Conn, 1
if not ors.eof then
ors.movefirst
do while not ors.eof
%>
<option value="<%= ors.fields("typ_id").value %>"><%= ors.fields("typ_libelle").value %></option>
<%
ors.movenext
loop
end if
ors.close %>
</select>
</div>
</div>
<!-- Text input-->
<div class="form-group">
<label class="col-md-4 control-label" for="selectbasic">Sous-type</label>
<div class="col-md-4">
<select name="acc_id_sous_type" class="form-control soustype">
<%
req = "SELECT sou_id, sou_libelle FROM sous_types WHERE sou_id_type = 1<-- cet id doit changer en fonction du premier Select;"
ors.open req, Conn, 1
if not ors.eof then
ors.movefirst
do while not ors.eof
%>
<option class="typevalue" value="<%= ors.fields("sou_id").value %>"><%= ors.fields("sou_libelle").value %></option>
<%
ors.movenext
loop
end if
ors.close %>
</select>
</div>
</div> |