473,322 Members | 1,232 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Form drop down help (null values)

I'm trying to make a drop down menu, when you select a few options I want it
to do *nothing* at all, null. The following works perfectly in IE6, but it
doesn't seem to worm in Opera 6 and IE5. When I select the valued options,
then do nothing too. Can anyone please have a quick look @ this code and
help me out a little :
<form method="post" action="#">
<select name="dropdown" onChange="javascript:if (this.value !=
0){location.href(this.value)};">
<option value="">Please Choose...</option>
<option value="">~~~~~~~~~~~~~~</option>
<option value="1.php">Oranges</option>
<option value="2.php">Apples</option>
<option value=""></option>
</select>
</form>

Jul 20 '05 #1
2 5489
Hi!

Use something like

if (this.options[this.selectedIndex].value) {location.href =
this.options[this.selectedIndex].value}

Here "selectedIndex" is # of selceted 'option'.

--
Sergey.
http://www.takereal.com/freelance/resume.asp
"mark" <no*************@blahblahblahbs.com> wrote in message
news:bm**********@news8.svr.pol.co.uk...
I'm trying to make a drop down menu, when you select a few options I want it to do *nothing* at all, null. The following works perfectly in IE6, but it
doesn't seem to worm in Opera 6 and IE5. When I select the valued options,
then do nothing too. Can anyone please have a quick look @ this code and
help me out a little :
<form method="post" action="#">
<select name="dropdown" onChange="javascript:if (this.value !=
0){location.href(this.value)};">
<option value="">Please Choose...</option>
<option value="">~~~~~~~~~~~~~~</option>
<option value="1.php">Oranges</option>
<option value="2.php">Apples</option>
<option value=""></option>
</select>
</form>

Jul 20 '05 #2
"Sergey I.Grachyov" <gr******@infopro.spb.su> wrote in message
news:bm**********@news.peterlink.ru...
Hi!

Use something like

if (this.options[this.selectedIndex].value) {location.href =
this.options[this.selectedIndex].value}


excellent!! that works great

many thanks

mark
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Flos | last post by:
Hello! (sorry for my bad english) the following problem: i have i site where one must enter data which is safed in a database. There are also drop down lists, which values are database...
5
by: Bandit | last post by:
Hi there, I am looking for any help with a form I am trying to make, one of the feilds I want it to be a drop down menu, so this part of the form has set values and nothing else. I have tried a...
2
by: AA Arens | last post by:
Somebody willing to assist me in the following? I want to have values from one field copied to another field when I choose choose a item from a drop down menu. I have 2 forms: 1 Company...
1
by: tony | last post by:
Hello!! Hello Victor! I use a product called flygrid to create grid tables. In many of my forms I create such grid tables. Some columns in these grid tables is of type drop down list where I...
4
by: rszebras | last post by:
I inherited a database (as a novice at Access) and need to modify it to make it more efficient, i.e., the assignment form needs to autopopulate with the client's name, address, phone number, etc.,...
2
by: justplain.kzn | last post by:
Hi, I have a table with dynamic html that contains drop down select lists and readonly text boxes. Dynamic calculations are done on change of a value in one of the drop down select lists. ...
4
by: jtertin | last post by:
I have a drop-down control that is being populated by an entire table (not a query). There are NULL values in the table which appear as blank spaces in the drop down. How can I format the drop...
61
by: bonneylake | last post by:
Hey Everyone, Well after asking many questions i have this almost working. This is how it works. Basically i fill in my customer number field an that populates my drop down box. Once i select...
0
by: sandeepsangshetty | last post by:
How do I create a drop down list which has the values from a database column. So I need this list to have values like" "Select distinct departmentname from Department" The Department name...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.