javascript - Parent fancybox closes if another fancybox opens in it -


i have popup using fancybox. has different buttons in it. when try click edit button opens dialog box( can edit other name ) fancybox in background closes on own not able go parent fancybox.

    <div  id='tempfancyboxlayeredit' style="display: none; width:100%; padding:10px">                  <table class="two columns">         <tr><h5>edit layer name</h5></tr>         <tr>             <td> new name:                  <input type ="text" id="txtlayernameedit" name="txtlayernameedit" path="name" />                  <span  class="error hidden" id="span-projectname-errors">* required</span>             </td>         </tr>         <tr>             <td>                 <button id="btncreate" class="small button" onclick="updatelayername()">update</button>             </td>             <button id="btncreate" class="small button" onclick="editmetricname()">edit</button>              <td>                 <button id="btncancelmetric" class="small button" onclick="return closediaglog()">cancel</button>             </td>             <td></td>             <td></td>         </tr>     </table>     </div>  function editmetricname() {        popupduplicatedialogmetricedit();  } function popupduplicatedialogmetricedit() {     $("#txtmetricnameedit").val("");       $.fancybox({href:'#tempfancyboxmetricedit', closebtn: false, helpers:{overlay: {closeclick:false}}});     }  function updatemetricname() {   //check if new metric name entered or not.    var isvalid = true;     var newmetricname = $("#txtmetricnameedit").val();     if (newmetricname == null || newmetricname == "") {     $("#txtmetricnameedit").focus();     $("#span-projectname-errors").removeclass("hidden");    isvalid = false; }    else {      if( newmetricname.indexof(":") >= 0 || newmetricname.indexof("\"") >= 0 || newmetricname.indexof("%") >= 0 ||          newmetricname.indexof("?") >= 0 || newmetricname.indexof("*") >= 0 || newmetricname.indexof("<") >= 0           || newmetricname.indexof(">") >= 0 || newmetricname.indexof("|") >= 0) {          alert("name of metric cannot contain characters such :, \",?,*,<,>,|,%,or % ");          isvalid = false;      }   }      if(isvalid){                         l_sselectmetriccontrol.find(':selected').text($('#txtmetricnameedit').val());            closediaglog();         updatemetricfromgui();     } }  <div  id='tempfancyboxmetricedit' style="display: none; width:100%; padding:10px">                  <table class="two columns">         <tr><h5>edit metric name</h5></tr>         <tr>             <td> new name:                  <input type ="text" id="txtmetricnameedit" name="txtmetricnameedit" path="name" />                  <span  class="error hidden" id="span-projectname-errors">* required</span>             </td>         </tr>         <tr>             <td>                 <button id="btncreate" class="small button" onclick="updatemetricname()">update</button>             </td>             <td>                 <button id="btncancelmetric" class="small button" onclick="return closediaglog()">cancel</button>             </td>             <td></td>             <td></td>         </tr>     </table>     </div> 


Comments

Popular posts from this blog

javascript - Bootstrap Popover: iOS Safari strange behaviour -

Magento/PHP - Get phones on all members in a customer group -

session - Logging Out Using PHP -