jquery - customized javascript confirmation box -
i have customized confirmation box....when press logout box displayed...if cancel pressed box closed control remains in same page...when yes pressed ,logout has take place....for me,cancel working fine...but when user presses yes, there no response....could me...thanks in advance...
my code:
<s:a href="logout" cssclass="plantabheader" id="logoutid"> <img src="../../ky/images/common/header/lock.png" alt="logout" style="border: none;background-color: transparent;" /> log out</s:a>
javascript:
<script type = "text/javascript" > $(document).ready(function () { $($('#logoutid')).click(function (event) { var msg = ""; var buttons = {}; msg = "are sure want logout?"; buttons["yes"] = dologout; buttons["cancel"] = closedialog; if (msg != "") { showdialog(buttons, "cancelconfirm", msg, "dialognormal", "confirmation", 470); } return false; }); }); function dologout() { document.getelementbyid("logoutid").href = "logout"; } function closedialog() { /* alert("action closedialog"); */ $("#cancelconfirm").dialog("close"); $("#cancelconfirm").dialog("destroy"); } </script>
expanding on comment above maybe function should
function dologout() { window.location = "/logout"; // not sure on url structure }
Comments
Post a Comment