I'm having trouble making a bit of Javascript work. I
have a form that preselects the user's previous selection
on return to the ASP page, but it only works as long as
no database is involved. Works great posting to "Other"
or "ASP" but as soon as the post is to a database the
code stops working. Here's the code:
****************

<%itemToSelect = Session("item1")%>

<script type "text/Javascript"><!--
function PreselectMyItem(itemToSelect)
{
var myDropDownList = document.forms(0).Center;
for (i = 0; i < myDropDownList.options.length;
i++)
{
if(myDropDownList.options[i].value ==
itemToSelect)
{
myDropDownList.options[i].selected = true;
break;
}
}
}
--></script>

</head>

<body onload="PreselectMyItem('<%=itemToSelect%>')">
******************
The form posts to a FP-generated database.

Any direction would be greatly appreciated!
Thanks.
Chuck

Re: pre-loading select menu not working with database by MD

MD
Thu Oct 07 03:35:30 CDT 2004

Hi Chuck,

See my response to your first post in this NG.


--
Mike -- FrontPage MVP '97-'02
J-Bots 2004 Released Special Pricing
http://www.websunlimited.com
FrontPage Add-ins Since '97 FP 2003 / 2002 / 2000 Compatible

"Chuck" <anonymous@discussions.microsoft.com> wrote in message news:39c801c4abfa$94ec62f0$a501280a@phx.gbl...
> I'm having trouble making a bit of Javascript work. I
> have a form that preselects the user's previous selection
> on return to the ASP page, but it only works as long as
> no database is involved. Works great posting to "Other"
> or "ASP" but as soon as the post is to a database the
> code stops working. Here's the code:
> ****************
>
> <%itemToSelect = Session("item1")%>
>
> <script type "text/Javascript"><!--
> function PreselectMyItem(itemToSelect)
> {
> var myDropDownList = document.forms(0).Center;
> for (i = 0; i < myDropDownList.options.length;
> i++)
> {
> if(myDropDownList.options[i].value ==
> itemToSelect)
> {
> myDropDownList.options[i].selected = true;
> break;
> }
> }
> }
> --></script>
>
> </head>
>
> <body onload="PreselectMyItem('<%=itemToSelect%>')">
> ******************
> The form posts to a FP-generated database.
>
> Any direction would be greatly appreciated!
> Thanks.
> Chuck



Re: pre-loading select menu not working with database by Chuck

Chuck
Thu Oct 07 11:13:32 CDT 2004

Sorry about the dup post- I actually canceled the first
post when I saw a mis-spelling after hitting "send", but
it went anyway without giving me an indication that it
went.

Chuck

>-----Original Message-----
>Hi Chuck,
>
>See my response to your first post in this NG.
>
>
>--
>Mike -- FrontPage MVP '97-'02
>J-Bots 2004 Released Special Pricing
>http://www.websunlimited.com
>FrontPage Add-ins Since '97 FP 2003 / 2002 / 2000
Compatible
>
>"Chuck" <anonymous@discussions.microsoft.com> wrote in
message news:39c801c4abfa$94ec62f0$a501280a@phx.gbl...
>> I'm having trouble making a bit of Javascript work. I
>> have a form that preselects the user's previous
selection
>> on return to the ASP page, but it only works as long as
>> no database is involved. Works great posting
to "Other"
>> or "ASP" but as soon as the post is to a database the
>> code stops working. Here's the code:
>> ****************
>>
>> <%itemToSelect = Session("item1")%>
>>
>> <script type "text/Javascript"><!--
>> function PreselectMyItem(itemToSelect)
>> {
>> var myDropDownList = document.forms(0).Center;
>> for (i = 0; i < myDropDownList.options.length;
>> i++)
>> {
>> if(myDropDownList.options[i].value ==
>> itemToSelect)
>> {
>> myDropDownList.options[i].selected = true;
>> break;
>> }
>> }
>> }
>> --></script>
>>
>> </head>
>>
>> <body onload="PreselectMyItem('<%=itemToSelect%>')">
>> ******************
>> The form posts to a FP-generated database.
>>
>> Any direction would be greatly appreciated!
>> Thanks.
>> Chuck
>
>
>.
>

Re: pre-loading select menu not working with database by Tom

Tom
Thu Oct 07 12:03:37 CDT 2004

Posts are not cancellable on MS servers.
--
===
Tom "Pepper" Willett
Microsoft MVP - FrontPage
---
About FrontPage 2003:
http://office.microsoft.com/home/office.aspx?assetid=FX01085802
FrontPage 2003 Product Information:
http://www.microsoft.com/office/frontpage/prodinfo/default.mspx
Understanding FrontPage:
http://msdn.microsoft.com/office/understanding/frontpage/
FrontPage 2002 Server Extensions Support Center:
http://support.microsoft.com/default.aspx?scid=fh;en-us;fp10se
===
"Chuck" <anonymous@discussions.microsoft.com> wrote in message
news:19bf01c4ac88$97274740$a401280a@phx.gbl...
| Sorry about the dup post- I actually canceled the first
| post when I saw a mis-spelling after hitting "send", but
| it went anyway without giving me an indication that it
| went.
|
| Chuck
|
| >-----Original Message-----
| >Hi Chuck,
| >
| >See my response to your first post in this NG.
| >
| >
| >--
| >Mike -- FrontPage MVP '97-'02
| >J-Bots 2004 Released Special Pricing
| >http://www.websunlimited.com
| >FrontPage Add-ins Since '97 FP 2003 / 2002 / 2000
| Compatible
| >
| >"Chuck" <anonymous@discussions.microsoft.com> wrote in
| message news:39c801c4abfa$94ec62f0$a501280a@phx.gbl...
| >> I'm having trouble making a bit of Javascript work. I
| >> have a form that preselects the user's previous
| selection
| >> on return to the ASP page, but it only works as long as
| >> no database is involved. Works great posting
| to "Other"
| >> or "ASP" but as soon as the post is to a database the
| >> code stops working. Here's the code:
| >> ****************
| >>
| >> <%itemToSelect = Session("item1")%>
| >>
| >> <script type "text/Javascript"><!--
| >> function PreselectMyItem(itemToSelect)
| >> {
| >> var myDropDownList = document.forms(0).Center;
| >> for (i = 0; i < myDropDownList.options.length;
| >> i++)
| >> {
| >> if(myDropDownList.options[i].value ==
| >> itemToSelect)
| >> {
| >> myDropDownList.options[i].selected = true;
| >> break;
| >> }
| >> }
| >> }
| >> --></script>
| >>
| >> </head>
| >>
| >> <body onload="PreselectMyItem('<%=itemToSelect%>')">
| >> ******************
| >> The form posts to a FP-generated database.
| >>
| >> Any direction would be greatly appreciated!
| >> Thanks.
| >> Chuck
| >
| >
| >.
| >