Avatar billede martin86 Nybegynder
18. december 2002 - 17:10 Der er 3 kommentarer og
1 løsning

SELECTED ..... fungere ikke

Hvad er der galt med denne kode.... den skulle "SELECT".... men det gør den ikke:

<%
If rs("gruppe") = mini Then
    Response.Write "<select name='gruppe' size='1' style='font-family:verdana; font-size:10; background-color:#F0F0F0'>"
    Response.Write "<option SELECTED value='mini'>Mini</option>"
    Response.Write "<option value='lilleput'>Lille Put</option>"
    Response.Write "<option value='puslinge'>Puslinge</option>"
    Response.Write "<option value='dp'>Drenge/Pige</option>"
    Response.Write "<option value='junior'>Junior</option>"
    Response.Write "<option value='ynglinge'>Ynglinge</option>"
    Response.Write "<option value='senior'>Senior</option>"
    Response.Write "</select>" 

ElseIf rs("gruppe") = lilleput Then
    Response.Write "<select name='gruppe' size='1' style='font-family:verdana; font-size:10; background-color:#F0F0F0'>"
    Response.Write "<option value='mini'>Mini</option>"
    Response.Write "<option SELECTED value='lilleput'>Lille Put</option>"
    Response.Write "<option value='puslinge'>Puslinge</option>"
    Response.Write "<option value='dp'>Drenge/Pige</option>"
    Response.Write "<option value='junior'>Junior</option>"
    Response.Write "<option value='ynglinge'>Ynglinge</option>"
    Response.Write "<option value='senior'>Senior</option>"
    Response.Write "</select>"

ElseIf rs("gruppe") = puslinge Then
    Response.Write "<select name='gruppe' size='1' style='font-family:verdana; font-size:10; background-color:#F0F0F0'>"
    Response.Write "<option value='mini'>Mini</option>"
    Response.Write "<option value='lilleput'>Lille Put</option>"
    Response.Write "<option SELECTED value='puslinge'>Puslinge</option>"
    Response.Write "<option value='dp'>Drenge/Pige</option>"
    Response.Write "<option value='junior'>Junior</option>"
    Response.Write "<option value='ynglinge'>Ynglinge</option>"
    Response.Write "<option value='senior'>Senior</option>"
    Response.Write "</select>"

ElseIf rs("gruppe") = dp Then
    Response.Write "<select name='gruppe' size='1' style='font-family:verdana; font-size:10; background-color:#F0F0F0'>"
    Response.Write "<option value='mini'>Mini</option>"
    Response.Write "<option value='lilleput'>Lille Put</option>"
    Response.Write "<option value='puslinge'>Puslinge</option>"
    Response.Write "<option SELECTED value='dp'>Drenge/Pige</option>"
    Response.Write "<option value='junior'>Junior</option>"
    Response.Write "<option value='ynglinge'>Ynglinge</option>"
    Response.Write "<option value='senior'>Senior</option>"
    Response.Write "</select>"

ElseIf rs("gruppe") = junior Then
    Response.Write "<select name='gruppe' size='1' style='font-family:verdana; font-size:10; background-color:#F0F0F0'>"
    Response.Write "<option value='mini'>Mini</option>"
    Response.Write "<option value='lilleput'>Lille Put</option>"
    Response.Write "<option value='puslinge'>Puslinge</option>"
    Response.Write "<option value='dp'>Drenge/Pige</option>"
    Response.Write "<option SELECTED value='junior'>Junior</option>"
    Response.Write "<option value='ynglinge'>Ynglinge</option>"
    Response.Write "<option value='senior'>Senior</option>"
    Response.Write "</select>"

ElseIf rs("gruppe") = ynglinge  Then
    Response.Write "<select name='gruppe' size='1' style='font-family:verdana; font-size:10; background-color:#F0F0F0'>"
    Response.Write "<option value='mini'>Mini</option>"
    Response.Write "<option value='lilleput'>Lille Put</option>"
    Response.Write "<option value='puslinge'>Puslinge</option>"
    Response.Write "<option value='dp'>Drenge/Pige</option>"
    Response.Write "<option value='junior'>Junior</option>"
    Response.Write "<option SELECTED value='ynglinge'>Ynglinge</option>"
    Response.Write "<option value='senior'>Senior</option>"
    Response.Write "</select>"

Else
    Response.Write "<select name='gruppe' size='1' style='font-family:verdana; font-size:10; background-color:#F0F0F0'>"
    Response.Write "<option value='mini'>Mini</option>"
    Response.Write "<option value='lilleput'>Lille Put</option>"
    Response.Write "<option value='puslinge'>Puslinge</option>"
    Response.Write "<option value='dp'>Drenge/Pige</option>"
    Response.Write "<option value='junior'>Junior</option>"
    Response.Write "<option value='ynglinge'>Ynglinge</option>"
    Response.Write "<option SELECTED value='senior'>Senior</option>"
    Response.Write "</select>"

End If
%>
Avatar billede eagleeye Praktikant
18. december 2002 - 17:14 #1
du skal havde "" omrking en streng "mini" eller tror den det er en variable med nanvet mini:

If rs("gruppe") = "mini" Then


osv
Avatar billede nikrasitf Nybegynder
18. december 2002 - 17:14 #2
eh.. orker ik lige at glo hele koden igennem.
Men hva' med bare at vælge "view source" når siden er loadet,
og paste det herinde hvis du ik allerede fandt problemet sådan.
Avatar billede nikrasitf Nybegynder
18. december 2002 - 17:15 #3
oh ja, prob første linie... :)
Avatar billede martin86 Nybegynder
18. december 2002 - 17:18 #4
tak eagleeye
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester