javascript - Why Dialog is not opened when button is clicked? -


i have 3 dialogs opened clicking button...

i have linked both jquery-ui , jquery.min.js file , jquery-ui.css file...

but when click button redirects index page instead of opening dialog....

this jquery code....

$(function(){         $("#recipientdialogue").dialog({           autoopen:false,         });         $("#exclusiondialogue").dialog({           autoopen:false,         });         $("#suppressiondialogue").dialog({           autoopen:false,         });          $("openrecipient").click(function(){            $("#recipientdialogue").dialog("open");         });     }); 

this html code...

    <td colspan="3"><button id="openrecipient">choose recipients</div></td>           <td colspan="3"><button id="opensuppression">choose recipients</button></td>           <td colspan="3"><button id="openexclusion">choose recipients</button></td>  <div id="recipientdialogue">     <td colspan="3" style="padding-left: 55px;">       <div id="recipientcheck"></div>     </td> </div> <div id="suppressiondialogue">     <td colspan="3" style="padding-left: 55px;">        <div id="suppressioncheck"></div>      </td> </div> <div id="exclusiondialogue">     <td colspan="3" style="padding-left: 55px;">       <div id="exclusioncheck"></div>     </td> </div> 

this jquery code populate checkboxes static json array...

for(var i=0; i< encoded_recipient_array.length;i++){          jquery('<input/>', {type:'checkbox',             value: encoded_recipient_array[i].id,             name:'recipient_array[]'             }).appendto('#recipientcheck'); //append checkbox id value....         jquery('<p>',{'text':encoded_recipient_array[i].name             }).appendto('#recipientcheck'); //append label of checkbox ......         jquery('<br/>').appendto('#recipientcheck'); //looks better know...     } 

any help?

you missed # put before openrecipient button

$("#openrecipient").click(function(){      $("#recipientdialogue").dialog("open"); }); 

Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -