Thanks for all the answers to this thread.  I just have to say, where were
you all when I gave up and handcoded this junk this weekend?  Doesn't
everybody work all night and all weekend? LOL

I was under a tight deadline so I did what I had to to make it work.  I
think in a few weeks when I have more time I'm going to use one of your
looping suggestions.  This looks like much cleaner code than what I did.

Thanks again,
Ricki

-----Original Message-----
From: Ben Timby [mailto:[EMAIL PROTECTED]]
Sent: Monday, August 12, 2002 11:15 PM
To: ActiveServerPages
Subject: RE: preselect dropdown



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

I usually do the following:

'get your RS, assume first col is ID, and second is value:

SelectArray = rsTemp.GetRows
rsTemp.Close
Set rsTemp = Nothing

Response.Write("<select name=""test"">")
For X = 0 To Ubound(SelectArray, 2)
        If SelectArray(0, X) = PreSelectedValue Then
                Response.Write("<option value=""" & SelectArray(0, X) & """
selected>" & SelectArray(1, x)
        Else
                Response.Write("<option value=""" & SelectArray(0, X) & """>" &
SelectArray(1, x)
        End If
Next
Response.Write("</select>")

Ben Timby
Webexcellence
PH: 317.423.3548 x23
TF: 800.808.6332 x23
FX: 317.423.8735
[EMAIL PROTECTED]
www.webexc.com

- -----Original Message-----
From: Ricki Williams [mailto:[EMAIL PROTECTED]]
Sent: Sunday, August 11, 2002 12:21 AM
To: ActiveServerPages
Subject: preselect dropdown


How can I set the initially selected value in a drop down box to a
value
from my recordset like I can for a text box?

I can't seem to figure this one out.

ricki


- ---
You are currently subscribed to activeserverpages as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
%%email.unsub%%

-----BEGIN PGP SIGNATURE-----
Version: PGP 7.0.4

iQA/AwUBPViHp/nby1cCm2Q8EQLb9QCg4dT6TFbrRk/cfNUfgZ/pjdhIydgAoOGt
hl1JDALkD57RNy+2gpLvi2eK
=dgbT
-----END PGP SIGNATURE-----



---
You are currently subscribed to activeserverpages as:
[EMAIL PROTECTED]
To unsubscribe send a blank email to
%%email.unsub%%


---
You are currently subscribed to activeserverpages as: [email protected]
To unsubscribe send a blank email to [EMAIL PROTECTED]

Reply via email to