?
Solved

selectedIndex IE incompatibility?

Posted on 2003-02-27
9
Medium Priority
?
622 Views
Last Modified: 2008-03-17
Hello everybody,

Is there any kind of incompatibility in the propriety selectedIndex for Internet Explorer (I have version 6)?.

It is returning me -1 all the time but it works fine for Netscape (4.6).

Is there any other alternative to selectedIndex.

Many thanks,

Alvaro
0
Comment
Question by:AGonzalez42
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
9 Comments
 
LVL 7

Expert Comment

by:cubrovic
ID: 8035258
-1  means that none elemnts being selected.

Check your code when selecting options or send code to view it.
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 8035267
Hello Alvero,

document.forms[0].selectObject.selectedIndex is surely not an incompatibility problem.
It is a level before selectedIndex which your are addressing so you get no selectObject.

Show us the code and we can fide a common code for all browsers.

So long,
Zvonko

0
 

Author Comment

by:AGonzalez42
ID: 8035324
The name of the form is: Request_Update_Software_form
The select field is: Geomarket

<select name="Geomarket">
     <option>------
     <option>AKA, Alaska    
     <option>APG, Australasia    
     <option>ARM, Arabia    
.
.
.
</select>

if I try to print this:

document.Request_Update_Software_form.Geomarket.selectedIndex

before submitting the form (and clicking in one of the selections), it prints -1. It prints the correct index value using Netscape.
I have no clue.
Thanks for your help

Alvaro
0
Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

 

Author Comment

by:AGonzalez42
ID: 8035352
The name of the form is: Request_Update_Software_form
The select field is: Geomarket

<select name="Geomarket">
     <option>------
     <option>AKA, Alaska    
     <option>APG, Australasia    
     <option>ARM, Arabia    
.
.
.
</select>

if I try to print this:

document.Request_Update_Software_form.Geomarket.selectedIndex

before submitting the form (and clicking in one of the selections), it prints -1. It prints the correct index value using Netscape.
I have no clue.
Thanks for your help

Alvaro
0
 
LVL 7

Accepted Solution

by:
cubrovic earned 150 total points
ID: 8035394
All you have to do is to select one options element like default

<select name="Geomarket">
    <option>------
    <option selected>AKA, Alaska    
    <option>APG, Australasia    
    <option>ARM, Arabia    
.
.
.
</select>

and than it will works from the start
0
 

Author Comment

by:AGonzalez42
ID: 8035452
Sorry, the problem persists.
0
 
LVL 7

Expert Comment

by:cubrovic
ID: 8035613
can you send the code that i can try
0
 

Author Comment

by:AGonzalez42
ID: 8035624
Sorry, sorry!
It is working. Thank a lot.

Alvaro
0
 

Author Comment

by:AGonzalez42
ID: 8035637
Many thanks for your help!
Alvaro
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question