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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T12:20:45+00:00 2026-06-07T12:20:45+00:00

I am opening a dialog which dynamically loads ajax content. The dialog can be

  • 0

I am opening a dialog which dynamically loads ajax content.

The dialog can be opened from multiple buttons (CT head, CT Chest, etc).

When the dialog opens there is a < select > < /select > menu with an event handler that listens for a .change to occur.

The problem I am having is that the .change isn’t being triggered:

<script>
 $(document).ready(function(){

 $("button.ctIndicationList").change(function() {
     // alert('Value change to ' + $(this).attr('value')); <-- this won't trigger
     $('#dialogResult').html("loading...");
     $.ajax({
       type: "POST",
       url: $(this).attr('value') + ".php",
       // data: "q=" + $("#q").val(),
       success: function(msg){
         $('#dialogResult').html(msg);
          // alert( "Data Saved: " + msg );
       }
     });        

});
 $("#requestStudy").click(function() {
     alert('Your study has been ordered');
     $( "#dialog-form" ).dialog( "close" );
 });   
$( "button.create-user" )
    .button()
    .click(function() {
         alert($(this).attr('value') + ".php");
        // $("input.create-user").change(function() {
            $.ajax({
               type: "POST",
               url: $(this).attr('value') + ".php",
               // data: "q=" + $("#q").val(),
               success: function(msg){
                 $('#dialogResult').html(msg);
                  // alert( "Data Saved: " + msg );
               }
            });
             // $("#dialog-form").load($(this).attr('value') + ".php","?opt1=Cron&opt2=Spron");
             // $("#dialog-form" ).dialog( "open" );
        //    });   

        $( "#dialog-form" ).dialog( "open" );
});  
$('#dialog-form').dialog({ bgiframe: true,
    height: 600,
    width: 800,
    autoOpen: false,
    modal: true,
    overlay: {
        backgroundColor: '#000',
        opacity: 0.5
    }                
 });  

 });
 </script>

…

<div>
<div id="dialog-form" title="Radiology Requisition" style="display:none;">
<p class="validateTips">All form fields are required.</p>
<form>
<fieldset>
    <p>Indication:
    <select id="ctIndicationList" class="ctIndicationList">
    <option value="ajaxheadInjury">head injury</option>
    <option value="ajaxstroke">stroke / TIA</option>
    </select></p>
<p><label for="email">Clinical History</label></p>
<p><input type="text" name="email" id="email" value="" class="text ui-widget-content ui-corner-all" size="60" /></p>
<p><label for="email">Differential Diagnosis</label></p>
<P>1. <input type="text" name="email" id="email" value="" class="text ui-widget-content ui-corner-all" size="60" />
<p>2. <input type="text" name="email" id="email" value="" class="text ui-widget-content ui-corner-all" size="60" />
<p>3. <input type="text" name="email" id="email" value="" class="text ui-widget-content ui-corner-all" size="60" />
<p id="dialogResult">result is here</p>
<p><button id="requestStudy">Request Study</button><p>
</fieldset>
</form>
</div>

<p><button class="create-user" value="formCThead">CT Head - minor head injury</button></p>
<p><button class="create-user" value="formCTchest">CT Chest</button></p>
<p><button class="create-user" value="formCTabdomen">CT Abdomen / Pelvis</button></p>
<p><button class="create-user" value="formCTcarotid">CT Carotid Angiogram</button></p>                  
<p><button class="create-user" value="formCTcspine">CT c-spine</button></p>

</div>

One of the formCT__.php files that dynamically loads into the dialog is below.. they all look similar. You will notice that the < select id=”ctIndicationList” > is located here. This is what I am trying to trigger.

<form>
<fieldset>
    <p>Indication:
    <select id="ctIndicationList">
        <option value="ajaxheadInjury">head injury</option>
        <option value="ajaxstroke">stroke / TIA</option>
    </select></p>
    <p><label for="email">Clinical History</label></p>
    <p><input type="text" name="email" id="email" value="" class="text ui-widget-content ui-corner-all" size="60"></input></p>
    <p><label for="email">Differential Diagnosis</label></p>
    <P>1. <input type="text" name="email" id="email" value="" class="text ui-widget-content ui-corner-all" size="60"></input></p>
    <p>2. <input type="text" name="email" id="email" value="" class="text ui-widget-content ui-corner-all" size="60"></input></p>
    <p>3. <input type="text" name="email" id="email" value="" class="text ui-widget-content ui-corner-all" size="60"></input></p>
    <p id="dialogResult">result is here</p>
    <p><button id="requestStudy">Request Study</button><p>
</fieldset>
</form>
  • 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-07T12:20:46+00:00Added an answer on June 7, 2026 at 12:20 pm

    You need to delegate your handler since the target element does not exist when the page loads, also you have button.ctIndicationList for you selector instead of select.ctIndicationList

    $(document/* or some container element */).on('change', "select.ctIndicationList", function() {
        // alert('Value change to ' + $(this).attr('value')); <-- this won't trigger
        $('#dialogResult').html("loading...");
        $.ajax({
            type: "POST",
            url: $(this).attr('value') + ".php",
            // data: "q=" + $("#q").val(),
            success: function(msg){
                $('#dialogResult').html(msg);
                // alert( "Data Saved: " + msg );
            }
        });        
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am wondering how I can go about stopping a dialog from opening if
I did a cocoa application in which the file dialog box is opening when
I have extended my class with a dialog in which I have set content
I am opening a Child Modal Dialog window from my parent web page. The
I have a parent window from which i open a modal dialog on button
i am opening jQuery Dialog through the below code.The problem here is when i
I have JQuery UI Dialog opening on pressing CTRL + Q using the following
I need to open the search dialog (it's opening, for example, when I click
The issue: Simply put, my Progress dialog continuously says downloading data rather than opening
Opening an application( probably an .exe file) as an administrator in headless mode from

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.