No replies
zaphod
Offline
newbie
Last seen: 18 years 41 weeks ago
Timezone: GMT-7
Joined: 2004-02-28
Posts: 1
Points: 0

Hi,

I'm trying to setup a page with 2 div's...one contains a form with a select (dropdown menu), the other I want to load a url when an item is selected from the dropdown.

Here are my div's:

<div id="dropdown">
<form target="content">
<select name="ddmenu" onchange="changeDiv()">
<option value="" />-
<option value="submit_article.php" />Article
<option value="submit_news.php" />News
<option value="submit_movie_review.php" />Movie Review
<option value="submit_comic_review.php" />Comic Review
</select>
</form>
</div>

<div id="content">
</div>

and here is the javascript changeDiv() function:

function changeDiv()
{
        option = document.dropdown.forms[0].ddmenu.options[document.dropdown.forms[0].ddmenu.selectedIndex].value;
        document.content.location = option;
}

Now, Javascript isn't quite my forte, and I'm not very sure how to access the div's (which I'm sure is quite obvious). I'd appreciate if some nice person could provide a few pointers. Smile

Tags: