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 9170613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:02:55+00:00 2026-06-17T16:02:55+00:00

this code/markup in conjunction with a php script renders a multiple select input populated

  • 0

this code/markup in conjunction with a php script renders a multiple select input populated with options set to
files via a php script. The goal is when a user clicks on an option, the text file is read and output to a div $(“#txtbx”).
This works as planned in mozilla firefox, however ie9 does nothing, no error no output.
As you can see by the comments i’ve located the ofending piece of code. It is not an .each() issue as I first thought, nor is it a selector issue (i’ve referenced it directly by class: see the comment). Neither is it $(this) i’ve also tested that… it seems to be the event being attached to $(this) or the event itself. Where the ouput goes is irrelevant because it doesn’t make it past $(this).click(f). Any idea what is happening here?

<div id="txtbx">
</div>

<select id="REFselect" size="1">
<option class="REFoptions" value="./TXT/css.txt">css.txt</option>
<option class="REFoptions" value="./TXT/dns.txt">dns.txt</option>
</select>

$("#REFselect option").each(function () {
    $(this).click(function(){
        alert("test")
        /*
        $("#txtbx").load($(this).val(),function(responseTxt,statusTxt,xhr){
            $(this).html("<pre>"+responseTxt+"</pre>");
            if(statusTxt=="success")
              alert("External content loaded successfully!");
            if(statusTxt=="error")
              alert("Error: "+xhr.status+": "+xhr.statusText);

        });
        */
    });
});

This is the working code, I’m new to the site so I want to thank everyone for their answers they were very good. I don’t know how to award proper credit, I’m researching that.
Also I would love to know why the old code worked in FF and not IE.

$("#REFselect").change(function(){
        var select = $(this).val();

        $("#txtbx").load(select,function(responseTxt,statusTxt,xhr){
            $(this).html("<pre>"+responseTxt+"</pre>");
            if(statusTxt=="success")
              alert("External content loaded successfully!");
            if(statusTxt=="error")
              alert("Error: "+xhr.status+": "+xhr.statusText);  
        });
});
  • 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-17T16:02:55+00:00Added an answer on June 17, 2026 at 4:02 pm

    You’re tying your .click handler to the <option> elements (which do not have a click event to handle).

    Try setting it to the .change event of the <select> element.

    $("#REFselect").change(function (e) {
        alert("test")
        $("#txtbx").load($(this).val(), function (responseTxt, statusTxt, xhr) {
            $(this).html("<pre>" + responseTxt + "</pre>");
            if (statusTxt == "success") {
                alert("External content loaded successfully!");
            }
            if (statusTxt == "error") {
                alert("Error: " + xhr.status + ": " + xhr.statusText);
            }
        });
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Markup: <input type=text name=email /> Code: $(':text').focusout(function(){ $(this).validate(function(){ $(this).attr('name'); }); }); Plugin: (function($){ $.fn.validate
This code below allows me to find the word error in all my files
This code is the core of a much larger script that works great in
This code only renders a dodecahedron and completely ignores the glBegin(GL_TRIANGLES) block: glutSolidDodecahedron(); glBegin(GL_TRIANGLES);
I got this code: $('#la_freccia_dx').bind('click', function(){ boutique_next(); }); In my html markup I prevent
I'm using this code to find all interesting links in a page: soup.findAll('a', href=re.compile('^notizia.php\?idn=\d+'))
Here is the code am trying to merge merge multiple XML files. public static
I know I can place this code in the markup to create a repeater
I consistently come across this code smell where I am duplicating markup, and I'm
see this HTML markup: <input value=9961 name=c_id id=c_id type=hidden> <input name=user_id id=user_id value=1 type=hidden>

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.