<select name="antal"
<option value="5" <% if antal = "5" then%>selected<%end if %>>5</option>
<option value="10" <% if antal = "10" then%>selected<%end if %>>10</option>
<option value="15" <% if antal = "15" then%>selected<%end if %>>15</option>
<option value="20" <% if antal = "20" then%>selected<%end if %>>20</option>
<option value="50" <% if antal = "50" then%>selected<%end if %>>50</option>
</select>
Men du att direkt när man väljer något i listrutan så ska du skriva ut en länk beroende på vad du valt, isåfall får du lösa det med javascript. Eller hur menar du ?
<script>
function doSubmit(); {
intAntal = document.formNamn.antal.value
document.location.href='sidan.asp?antal=' + intAntal
}
</script>
<select name="antal" [red]onChange="doSubmit();"[/red]>
<option value="5" <% if antal = "5" then%>selected<%end if %>>5</option>
<option value="10" <% if antal = "10" then%>selected<%end if %>>10</option>
<option value="15" <% if antal = "15" then%>selected<%end if %>>15</option>
<option value="20" <% if antal = "20" then%>selected<%end if %>>20</option>
<option value="50" <% if antal = "50" then%>selected<%end if %>>50</option>
</select>
Men det är mer JavaScript än ASP. :)
Tråden flyttas.
Tillägg:
Kan nog se ut såhär med en parameter också, men jag är inte säker:
<script>
function doSubmit(intAntal); {
document.location.href='sidan.asp?antal=' + intAntal
}
</script>
<select name="antal" [red]onChange="doSubmit(this.value);"[/red]>
<option value="5" <% if antal = "5" then%>selected<%end if %>>5</option>
<option value="10" <% if antal = "10" then%>selected<%end if %>>10</option>
<option value="15" <% if antal = "15" then%>selected<%end if %>>15</option>
<option value="20" <% if antal = "20" then%>selected<%end if %>>20</option>
<option value="50" <% if antal = "50" then%>selected<%end if %>>50</option>
</select>
255 ms totalt · 4 externa anrop · v20260731065814-full.1dc6f849