Populate Dynamic dropdown box

Populate Dynamic dropdown box

am 26.02.2007 22:15:15 von Simon Gare

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

am 26.02.2007 22:40:44 von reb01501

Simon Gare wrote:
> 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?
>

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

am 26.02.2007 22:48:56 von Simon Gare

Thanks Bob,

Got it



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

Simon

..
"Bob Barrows [MVP]" wrote in message
news:OhPbG7eWHHA.192@TK2MSFTNGP04.phx.gbl...
> Simon Gare wrote:
> > 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?
> >
>
> 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

am 26.02.2007 23:04:36 von Simon Gare

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


"Simon Gare" wrote in message
news:%23pSWcAfWHHA.4964@TK2MSFTNGP06.phx.gbl...
> Thanks Bob,
>
> Got it
>
>
>
> Worked perfectly trying too hard again I was Dim this and Dim that couldnt
> get my head around it.
>
> Simon
>
> .
> "Bob Barrows [MVP]" wrote in message
> news:OhPbG7eWHHA.192@TK2MSFTNGP04.phx.gbl...
> > Simon Gare wrote:
> > > 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?
> > >
> >
> > 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

am 26.02.2007 23:04:48 von reb01501

Simon Gare wrote:
> Thanks Bob,
>
> Got it
>
>
>
> Worked perfectly trying too hard again I was Dim this and Dim that
> couldnt get my head around it.
>
> Simon
>

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

am 26.02.2007 23:06:49 von exjxw.hannivoort

Simon Gare wrote on 26 feb 2007 in
microsoft.public.inetserver.asp.general:

>
>

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~
%>




--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Re: Populate Dynamic dropdown box

am 26.02.2007 23:39:29 von reb01501

Simon Gare wrote:
> 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" %>
>
> ??
>
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.

Re: Populate Dynamic dropdown box

am 26.02.2007 23:50:48 von Simon Gare

it did Bob thanks



Regards
Simon

"Bob Barrows [MVP]" wrote in message
news:eBJf8bfWHHA.996@TK2MSFTNGP02.phx.gbl...
> Simon Gare wrote:
> > 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" %>
> >
> > ??
> >
> 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.
>
>