javascript - jQuery UI dialog reloads the page when you click on close button. What is wrong? -


I have two buttons in my dialog if I click on the close button, the dialog box closes and the page reloads goes. How to turn off the dialog without reloading the page? My code: add_bankday.dialog ({autoOpen: wrong, width: 400, button: [id: 'submit', text: & lt ;? php echo json_encode ('add' );; & Gt;, click: function (event) {if ($ ('$ password'). Val ()! = Calendar.resource.password) {$ ('# error'). Text (& lt; ? Php echo json_encode ('wrong password');;> CSS ('visibility', 'visible'); return;} $ .ajax ({type: 'POST', url: 'ajax.php', async: False, data: {Op: 'add_bankday', day: $ ('# new_bank_day'). Val (), password: $ ('# ab_password'). Val ()}, success: function (res) {}}) ;}}, {Id: 'bank_close', text: & lt ;? php echo json_encode ('closed');? & Gt ;, click on: function () {$ ('# new_bank_d ('');. Val ('');. $ ('# Add_bankday') dialog ('pass');}}]});

Just one idea: because it looks like you're using AJAX requests, make sure that you have disabled any of the common HTML form submission controls and Use plain HTML buttons!


Comments

Popular posts from this blog

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -