Meaningless Drivel is fun!
The moose likes HTML, CSS and JavaScript and the fly likes problem with OPTION tag Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "problem with OPTION tag" Watch "problem with OPTION tag" New topic

problem with OPTION tag

Denver Crisostomo

Joined: Nov 01, 2007
Posts: 7
hi guys,

I have this problem concerning OPTION tag of SELECT tag..
I have this OPTION tag value "SELECT ITEMS BELOW":
<option>SELECT ITEMS BELOW </option>
<option value=""> Google </option>

When I choose Google item and opens a new window, and then I closed it and then choosed the SELECT ITEMS BELOW, it displays an error or undesirable blank page..

My question is, how can I make the page to not do anything when I choose SELECT ITEMS BELOW?

Thanks for your help guys.

Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63837

Just selecting a select option isn't going to do anything on its own. How are you effecting the transition to a new page? That's what you need to make sensitive to which option is selected.

[Asking smart questions] [About Bear] [Books by Bear]
Mike Firkser
Ranch Hand

Joined: Oct 21, 2003
Posts: 248

My first question is do you call a function on the <select> tag's onchange event. If you do, the "Select Items Below" option has no value, and that may cause the problem.

Mike Firkser
Rutgers '84
Joanne Bangasan

Joined: May 10, 2008
Posts: 11
Is it something like this?

<select name="mylinks" onchange=";">
<option>SELECT ITEMS BELOW </option>
<option value=""> Google </option>

Maybe it can be added with:
<select name="mylinks" onchange="if (this.selectedIndex > 0);">
I agree. Here's the link:
subject: problem with OPTION tag
It's not a secret anymore!