Register  |  Login




Advertisement

Start Your Own Q&A Site

Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.

Question

Status: Open Points: 75 Time: 12:57 - Apr 09, 2008  

texaspancake

how do you resolve 'options' is null or not an object in Internet Explorer?

I am currently working on an issue with an e-commerce page that goes to a form to enter your information. The order process works fine but there is an annoying issue with Internet Explorer stating.... A Runtime Error has occured. Do you wish to Debug... Etc Error: 'options' is null or not an object. I looked at the code to debug and this is the particular problem area

function init_state_menu(country_field) {
var country_menu = document.getElementsByName(country_field)[0];
var country_id = country_menu.options[country_menu.selectedIndex].value;
generateStates(country_field, country_id);
}

I ran a test to see if the variable country_menu is defined and it states that is not defined. Any suggestions are appreciated. Thanks

Categories

Answer Discussion
Tutorials

 

paziek

Date:: Jul 11, 2008

Time:: 17:52

if(typeof(window.external) != 'undefined'){

//yes, this is evil browser sniffing, but only IE has this bug

document.getElementsByName = function(name, tag){
if(!tag){
tag = '*';
}
var elems = document.getElementsByTagName(tag);
var res = []
for(var i=0;i<elems.length;i++){
att = elems[i].getAttribute('name');
if(att == name) {
res.push(elems[i]);
}
}
return res;
}

}

its from msdn forums
ps. tag is optional for this method, it will default to wildcard * if not specified (meaning it will check all elements in the document for given name)

admin

Date:: Mar 04, 2009

Time:: 10:07

The question looks to be abandoned by the user who asked it. If no action is taken within 2 days, a Quomon Moderator will consider closing the question and distributing the points.

The Quomon Team

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

Tutorials cannot be submitted until the Answer Discussion is complete.

Submit answers in the Answer Discussion area

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top Experts

View More

Rank

Expert

Points

1.

nidhi

10354

2.

oracleofDelphi

6493

3.

rcastagna

5596

4.

LAGM

4848

5.

PeterNZ

3487

6.

gonzalo

2840

7.

Mason

2770

8.

jgivoni

2303

9.

xarcus

1820

10.

Anpanman

917

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it



Language Options

English:

www.quomon.com

Español:

www.quomon.es