Note that there are some explanatory texts on larger screens.

plurals
  1. POJQuery: Dialog box title is not updated
    primarykey
    data
    text
    <p>I need to update the title of Dialog box upon the selection of an Image. I debug in chrome's <code>Inspect Element</code> and my observation regarding the value is given in comment below:</p> <pre><code>function setDialogTitle(item){ // item is input#searchclassimg.imagewrapper var id = item.id; // gives id of selected element switch(id){ // dialog is a div, whose default title is "Some picker" case "searchclassimg": $('#dialog').attr('title', 'Class Picker'); //after this i expect dialog's title to be updated as "Class Picker" break; case "searchsectionimg": $('#dialog').attr('title', 'Section Picker'); break; case "searchrollnoimg": $('#dialog').attr('title', 'Roll No Picker'); break; case "searchnameimg": $('#dialog').attr('title', 'Name Picker'); break; } } $(document).ready( function() { if (!window.jQuery) { document .write('&lt;link rel="stylesheet" href="/WEB-INF/lib/jquery-ui-themes-1.10.3/themes/smoothness/jquery-ui.css"&gt;&lt;\/link&gt;'); document .write('&lt;script src="/WEB-INF/lib/jquery-1.10.1.js"&gt;&lt;\/script&gt;'); document .write('&lt;script src="/WEB-INF/lib/jquery-ui.js"&gt; &lt;\/script&gt;'); } var counter = 0; $(".imagewrapper").click(function() { $("#dialog").dialog(); setDialogTitle(this); if (counter &lt; 1) { $("#searchboxdiv").after('&lt;hr id="separator1"&gt;'); $("#separator1").after('&lt;div id="contents" class="container"&gt; &lt;/div&gt;'); setDialogItems(); counter++; } }); $(document).on('click', "#searchbutton", function() { var data1 = $("#searchbox").val(); $.ajax({ url : "FormHandler", data : { data1 : data1 }, success : function(result) { var result = null; } }); }); </code></pre> <p>ImageWrapper is <code>&lt;div&gt;</code> under which multiple elements are defined. What i get after execution is "Some Picker" only. Where i am making mistake please point it out.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload