473,320 Members | 2,054 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,320 software developers and data experts.

Cannot get value of drop down box with IE7

1
I have a check in some Perl cgi pages where using some JavaScript to if a drop down box has a value set or not, if not then an alert to the user to select an OU.

The problem I have is that the check works fine in IE8, FireFox and Chrome, but the check does not work in IE7, in IE7 the check always comes back as null.

Expand|Select|Wrap|Line Numbers
  1. <script language=javascript>
  2.  
  3. function validateData() {
  4.     if ((!(typeof(document.update.ou_new)== "undefined")) && (document.update.ou_new.options[document.update.ou_new.selectedIndex].value == "")) {
  5.         alert("Please select an (ou)");
  6.         return false;
  7.     }
  8.     document.update.submit();
  9.     return true;
  10. }
  11. </script>
  12.  
Can anyone tell me why the check of:

document.update.ou_new.options[document.update.ou_new.selectedIndex].value == ""

Always comes back empty with IE7 even if there is a value there, in IE8 and others the value comes back as expected.
Feb 21 '12 #1
1 1662
acoder
16,027 Expert Mod 8TB
Could you post the corresponding HTML code?
Feb 27 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

46
by: Kingdom | last post by:
In my data base I have a list of componet types e.g. type A - I have 8 off - type B I have 12 off etc. I'm using Set objRS = objDC.Execute("Select DISTINCT Component_Type FROM Parts_Table") ...
2
by: ehm | last post by:
I am working on creating an editable grid (for use in adding, deleting, and editing rows back to an Oracle database). I have a JSP that posts back to a servlet, which in turns posts to a WebLogic...
1
by: ehm | last post by:
I apologize in advance for the cross-post (from microsoft.public.inetexplorer.scripting), but that board seems dead. I have what I think is a fairly simple problem, but I cannot figure this out....
1
by: Dan | last post by:
This is one that has me stumped and I need an expert's input. Any ideas why the values from the second script-generated drop down list isn't recognized by the script to add time values to the...
2
by: Yoshitha | last post by:
hi I have 2 drop down lists in my application.1st list ontains itmes like java,jsp,swings,vb.net etc.2nd list contains percentage i.e it conatains the items like 50,60,70,80,90,100. i will...
5
by: Vigneshwar Pilli via DotNetMonster.com | last post by:
string connectionString1 = "server=(local); user=sa;password=sa; database=sonic"; System.Data.SqlClient.SqlConnection dbConnection1 = new System.Data.SqlClient.SqlConnection(connectionString1);...
3
by: John Walker | last post by:
Hi, On an ASP.NET page I have a drop down list control. When the user pulls down the list and makes a selection, I perform validation, and if the validation fails I want the selected item in...
4
by: deepee | last post by:
I have a drop down box in HTML using SELECT and OPTION tags: <select title="Choose a number" onchange="obscure()" name="Digit1" ID="Digit1"> <OPTION VALUE="">&nbsp;</OPTION> <OPTION...
3
by: scott | last post by:
Hello all, I am ripping my hair out over this and maybe someone could help. I have a site that has groups and subgroups of those groups that all have int id's. I am trying to have a...
2
by: leeperman | last post by:
In Dreaweaver I cannot filter my database results to display only specific data that is retrieved from mulptile drop down list on my search page. The drop down list selections are posted to my...
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...
1
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: 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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.