all groups > inetserver asp general > february 2007 >
You're in the

inetserver asp general

group:

Populate Dynamic dropdown box


Re: Populate Dynamic dropdown box Bob Barrows [MVP]
2/26/2007 4:40:44 PM
inetserver asp general:
[quoted text, click to view]

As you write each option string to Response, compare the string you are
writing as the option's value to the data in the recordset. If They are
the same, write "selected" to response before closing the option's tag.
Otherwise, don't write "selected".

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Re: Populate Dynamic dropdown box Bob Barrows [MVP]
2/26/2007 5:04:48 PM
[quoted text, click to view]

That works?? If you say so ...
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Re: Populate Dynamic dropdown box Bob Barrows [MVP]
2/26/2007 5:39:29 PM
[quoted text, click to view]
Yes, that's more like it. Have you tried it? Does it work? If not, write
the value of ACCESS_LEVEL(0) to Response and show us what it is.
--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.

Populate Dynamic dropdown box Simon Gare
2/26/2007 9:15:15 PM
Hi,

have form on asp page that recalls data from the recordset and populates all
the fields except the dynamic dropdown box that doesn't, just shows default
value. How do I make it populate based on the entry in the db?

Regards
Simon


--
Simon Gare
The Gare Group Limited

website: www.thegaregroup.co.uk
website: www.privatehiresolutions.co.uk

Re: Populate Dynamic dropdown box Simon Gare
2/26/2007 9:48:56 PM
Thanks Bob,

Got it

<select name="Access_level" id="select2">
<option value"">Select access level</option>
<option value="1" <% response.write "selected"
%>>Driver</option>
<option value="2" <% response.write "selected" %>>Operator /
Controller</option>
<option value="3" <% response.write "selected"
%>>Administrator</option>
</select>

Worked perfectly trying too hard again I was Dim this and Dim that couldnt
get my head around it.

Simon

..
[quoted text, click to view]

Re: Populate Dynamic dropdown box Simon Gare
2/26/2007 10:04:36 PM
Bob,

have a problem, the way I did it hasn't worked should I be doing something
like,

<% if ACCESS_LEVEL(0) = true then response.write "selected" %>

??

Simon


[quoted text, click to view]

Re: Populate Dynamic dropdown box Evertjan.
2/26/2007 10:06:49 PM
Simon Gare wrote on 26 feb 2007 in
microsoft.public.inetserver.asp.general:

[quoted text, click to view]

I don't think this is very useful as it just places a selected in each
option, so probably the top one will have an effect.


<%
s = ~numeric result from database~
%>

<select name="Access_level" id="select2">
<option value="">
Select access level</option>
<option value="1" <% if s=1 then response.write "selected" %>>
Driver</option>
<option value="2" <% if s=2 then response.write "selected" %>>
Operator / Controller</option>
<option value="3" <% if s=3 then response.write "selected" %>>
Administrator</option>
</select>


--
Evertjan.
The Netherlands.
Re: Populate Dynamic dropdown box Simon Gare
2/26/2007 10:50:48 PM
it did Bob thanks

<option value="00:10" <% if (AirportStation.Fields.Item("LeadTime").Value) =
("00:10:00") then response.write "selected" %>>10 Mins</option>

Regards
Simon

[quoted text, click to view]

AddThis Social Bookmark Button