• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with OPTION tag

 
Denver Crisostomo
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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="www.google.com"> 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.

Denver
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64717
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Mike Firkser
Ranch Hand
Posts: 249
Java Oracle PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Joanne Bangasan
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it something like this?

<select name="mylinks" onchange="window.open(this.value);">
<option>SELECT ITEMS BELOW </option>
<option value="http://www.google.com"> Google </option>
</select>

Maybe it can be added with:
<select name="mylinks" onchange="if (this.selectedIndex > 0) window.open(this.value);">
...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic