473,586 Members | 2,695 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="javas cript:if (this.value !=
0){location.hre f(this.value)}; ">
<option value="">Please Choose...</option>
<option value="">~~~~~~ ~~~~~~~~</option>
<option value="1.php">O ranges</option>
<option value="2.php">A pples</option>
<option value=""></option>
</select>
</form>

Jul 20 '05 #1
2 5501
Hi!

Use something like

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

Here "selectedIn dex" is # of selceted 'option'.

--
Sergey.
http://www.takereal.com/freelance/resume.asp
"mark" <no************ *@blahblahblahb s.com> wrote in message
news:bm******** **@news8.svr.po l.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="javas cript:if (this.value !=
0){location.hre f(this.value)}; ">
<option value="">Please Choose...</option>
<option value="">~~~~~~ ~~~~~~~~</option>
<option value="1.php">O ranges</option>
<option value="2.php">A pples</option>
<option value=""></option>
</select>
</form>

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

Use something like

if (this.options[this.selectedIn dex].value) {location.href =
this.options[this.selectedIn dex].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
1837
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 driven. the user can and must sometimes ad values to this drop down list.
5
22063
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 few times too make this work, but I can never make it work, I can`t even seem to find help ojnline for this issue. If anyone here can geve me...
2
2079
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 contact info 2 Employee contact info When I finished form 1, I jump to form 2.
1
2342
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 can select a value from the list. Below I have some code which exist in a file named StringClass.cs
4
2730
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., when you select the cust id. Found this cited as a good method: http://www.mvps.org/access/forms/frm0058.htm I have two tables (clients,...
2
2105
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. Using Safari,my first iteration the script works fine ( indicating that there are 33 form variables ). When trying another dropdown select value, the
4
2192
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 down to put some static text in place of the empty space. (For example 'Available', or 'Not Defined')
61
5291
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 an option from the drop down box it populates the rest of the form. The problem i am having is that if a customer number doesn't exist in the drop...
0
2018
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 should show in the drop down list and I should be able to select one department name from the list. This is my code for read the column name from an...
0
8199
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8336
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7950
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8212
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6606
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5389
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2343
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1447
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1175
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.