Drop-Dowm-Box based on database results

J

Jim Wilson

I am not sure how or if I can do this in Front Page 2003
since this web stuff is all-new to me. I have a
database with two fields in a table; one is a name and
the other is a URL and what I would like to do using a
result based drop-down-box is have the name field
displayed and when a name is selected the page changes to
the URL next to the name in the database. If this cannot
be done please let me know if there is another way of
doing something like this. The result is not to edit the
drop-down-box each time a change is needed.


Any Help

Jim
 
J

Jim Buyens

To create the drop-down list box, set the insertion point
in an open Web page, then choose Database from the Insert
menu, and then Results. This starts the Database Results
Wizard.

Use pages 1, 2, and 3 of the wizard to select the
database, table, and fields you want to use.

On page 4 of the wizard, select Dropdown List - One Record
Per Item. Then, set Display Values From This Field to the
field that contains the text you want visitors to see, and
set Submit Values From This Field to the field that
contains the URL.

On page 5 of the wizard, *don't* specify Add Search Form.

After the wizard completes, add the following script to
the <head> section of the page, changing "hyper" (in two
places) to the field name you specified for Submit Values
From This Field.

<script>
function jumpOnChange(){
document.location.href=document.forms[0].hyper.value;
}
function setOnChange(){
document.forms[0].hyper.onchange=jumpOnChange;
}
</script>

Finally, add an onload= attribute to the <body> tag as
shown below.

<body onload="setOnChange();">

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 
J

Jens Peter Karlsen[FP-MVP]

Depending on what you have access to on the Server, you can use ASP or
PHP to populate the dropdown and then change the url depending on what
is selected.

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.

-----Original Message-----
From: Jim Wilson [mailto:[email protected]]
Posted At: 29. juli 2004 18:43
Posted To: microsoft.public.frontpage.programming
Conversation: Drop-Dowm-Box based on database results
Subject: Drop-Dowm-Box based on database results


I am not sure how or if I can do this in Front Page 2003
since this web stuff is all-new to me. I have a
database with two fields in a table; one is a name and the other is a
URL and what I would like to do using a result based drop-down-box is
have the name field displayed and when a name is selected the page
changes to the URL next to the name in the database. If this cannot be
done please let me know if there is another way of doing something like
this. The result is not to edit the drop-down-box each time a change is
needed.


Any Help

Jim
 
J

Jim Wilson

Thank you again for your help it works just how I was
thinking it would.

Jim Wilson
-----Original Message-----
To create the drop-down list box, set the insertion point
in an open Web page, then choose Database from the Insert
menu, and then Results. This starts the Database Results
Wizard.

Use pages 1, 2, and 3 of the wizard to select the
database, table, and fields you want to use.

On page 4 of the wizard, select Dropdown List - One Record
Per Item. Then, set Display Values From This Field to the
field that contains the text you want visitors to see, and
set Submit Values From This Field to the field that
contains the URL.

On page 5 of the wizard, *don't* specify Add Search Form.

After the wizard completes, add the following script to
the <head> section of the page, changing "hyper" (in two
places) to the field name you specified for Submit Values
From This Field.

<script>
function jumpOnChange(){
document.location.href=document.forms[0].hyper.value;
}
function setOnChange(){
document.forms[0].hyper.onchange=jumpOnChange;
}
</script>

Finally, add an onload= attribute to the <body> tag as
shown below.

<body onload="setOnChange();">

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------


-----Original Message-----
I am not sure how or if I can do this in Front Page 2003
since this web stuff is all-new to me. I have a
database with two fields in a table; one is a name and
the other is a URL and what I would like to do using a
result based drop-down-box is have the name field
displayed and when a name is selected the page changes to
the URL next to the name in the database. If this cannot
be done please let me know if there is another way of
doing something like this. The result is not to edit the
drop-down-box each time a change is needed.


Any Help

Jim

.
.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top