Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7931701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:48:01+00:00 2026-06-03T20:48:01+00:00

I have a HTML page that uses Javascript and it works fine in IE

  • 0

I have a HTML page that uses Javascript and it works fine in IE but it’s not quite working in Firefox, Chrome, or Safari. My code dynamically adds data to a dropdown in IE but I’m guessing my syntax isn’t quite right for FF, Chrome, or Safari? In FF, Chrome, Safari the dropdown box only shows the hard coded values and never gets updated in the 3 previously mentioned browsers. Assuming that my array is getting populated correctly in FF or Chrome, then I’m guessing the method I’m using to add data back to the dropdown box isn’t written the way FF or Chrome likes?

<script type="text/javascript">

dojo.require("esri.map");
    dojo.require("esri.tasks.route");
    dojo.require("esri.tasks.query");
var dynamicarray = [];

    queryTask.execute(query, showResults);

function showResults(results) {  //This is where I can add values to dropdown in IE

    var featureAttributes;
    var addoffices = document.getElementById("Office");
    var addrigs = document.getElementById("Rigs");

    for (var i = 0, il = results.features.length; i < il; i++) {
        featureAttributes = results.features[i].attributes;
        for (att in featureAttributes) {

            dynamicarray.push(featureAttributes[att]);
            if (isNaN(featureAttributes[att])) {
                addrigs.options.add(new Option(featureAttributes[att], att));
            }
            if (isNaN(featureAttributes[att])) {
                addoffices.options.add(new Option(featureAttributes[att], att));
            }
        }
     }
    }

function officeval() {


    d = document.getElementById("Office");
    var de = d.options[d.selectedIndex].text;
    addStop(de);                    


    }


 function addStop(evt) {

    var lat;
            var lon;
            var dar;
            for (dar in dynamicarray) {
                if (dynamicarray[dar] == evt) {
                    lon = dynamicarray[dar - 1]; //Get Longitude value
                    lat = dynamicarray[dar - 2]; //Get Latitude value

                    var inPoint = new esri.geometry.Point(lon, lat, map.spatialReference);
                    var stop = map.graphics.add(new esri.Graphic(inPoint, stopSymbol));
                    routeParams.stops.features.push(stop);

                    map.graphics.add(new esri.Graphic(new esri.geometry.Point(lon, lat, map.spatialReference), textSymbol));
                    break;
                }
            }
}
</script>

From: 
<SELECT id="Office" SIZE=0 onchange="officeval()">
<OPTION VALUE="0">
<OPTION VALUE="1"> Some Office
    <OPTION VALUE="2"> Warehouse Yard
</SELECT>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T20:48:03+00:00Added an answer on June 3, 2026 at 8:48 pm

    It works only in Internet Explorer as you’re using non-compliant code

    use:

    try {
        addrigs.options.add(new Option(featureAttributes[att], att), null); // standards compliant; doesn't work in IE
    }
    catch(ex) {
        addrigs.options.add(new Option(featureAttributes[att], att)) // IE only
    }
    

    see http://www.dzone.com/snippets/htmljavascript-select-list

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page that works on firefox and chrome. In IE7 i'm experiencing
I have an HTML page that uses AJAX to retrieve messages from a server.
I have an HTML page that uses the JSONP Plugin to gracefully handle errors
So, I have web page that uses javascript to let a user select different
Ok, so as the title says, I have an HTML page that I fetch
I have a page that loads an external HTML page into an iFrame. There
I have n number of select elements in an html page that are used
I have an HTML page with lot of tables. Among that I have a
I have created a html page in php and upon submission i validates that
Imagine that HTML page is a game surface (see picture). User can have n

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.