Forums

ASP

This topic is locked

Option > write "selected" dynamicaly

Posted 31 Mar 2003 11:48:07
1
has voted
31 Mar 2003 11:48:07 Tom Ka posted:
Hi all!

Problem: I have a editpage for one record in a DB with some fields. One field in the RS holds a number (but saved as text) which represents a categorie where this record is assigned to.

this value can be changed throug an Option box in the edit page.

the actual kategorie number is stored as strKategorie when i get the recordset out of the DB

The other values for the option box are also comming out of the DB.
now I want the current value (in strKategorie) to get the html-attribut selected in the option box.
so I wrote the following code (replaced html with brackets):

<pre id=code><font face=courier size=2 id=code>WHILE NOT RS.EOF

[option value="[%= RS("ContentID"%]" [% IF RS("ContentID" = strKategorie THEN Response.Write(" selected" %]][%= RS("Titel"%][/option&gt;

RS.MoveNext
</font id=code></pre id=code> and so on

I dont know why but it does not work.
anyone has an idea what i do wrong???

Thanx lot's

Reply to this topic