confirm

Redirecting on confirm true

≡放荡痞女 提交于 2019-12-12 23:41:14
问题 I want to make it so the user clicks a link, they get a confirm box. If they click OK, they get sent to a new php function. I've tried: function confirmReset() { var r = confirm('Are you sure?'); var url = window.location.pathname; var pathArray = url.split('/'); var host = pathArray[1]; var newHost = '/headquarters/designReset'; if (r == true) { window.location = host + newHost; //document.location.href = '/headquarters/designReset'; } else { alert('it didnt work'); } return false; }​

Show a confirm message before <p:rowEditor> updates the model on click of “OK” button

谁都会走 提交于 2019-12-12 18:24:02
问题 I'm using <p:rowEditor> as follows: <p:column headerText="Libellé"> <p:cellEditor> <f:facet name="output"> <h:outputText value="#{lot.libelle}" /> </f:facet> <f:facet name="input"> <p:inputText value="#{lot.libelle}" /> </f:facet> </p:cellEditor> </p:column> <p:column> <p:rowEditor /> </p:column> I would like to show a confirm message before the <p:rowEditor> updates the model on click of the "OK" button. How can I achieve this? 回答1: You can use onstart attribute of <p:ajax event="rowEdit">

Is it possible for onunload confirm to open a new url in the same window?

南楼画角 提交于 2019-12-12 04:09:30
问题 this is my first post and I'm a JS novice, so please forgive my ignorance... Heres my question, its in two parts: 1.) At onunload I want an alert that asks the user if they would like to go to a related URL. The code I'm using works, but it open the URL in a new window and this can be blocked by a pop-up blocker even though the user has opted-in. Is there a way to have it open in the same window and negate the pop-up blocker? 2.) is there a way to take the onunload function out of the body

Create confirm JavaScript for when users try to leave page without saving

核能气质少年 提交于 2019-12-12 03:52:28
问题 I am trying to make it so that if a user makes changes to a page and then tries to leave the page without saving, a popup message will appear with an "OK" button (no "Cancel" button). Clicking the "OK" button, closes the message. The user must click the "Save" button or they will keep getting the message, prohibiting them from leaving the page until the "Save" button is clicked. By leave the page, I mean keeping them from navigating to another tab or menu item within the site...if they click

javascript confirm cancel still submits form

时光怂恿深爱的人放手 提交于 2019-12-12 03:25:39
问题 I have the following sequence on a form page, first it runs through the captcha then it validates the email address and then asks if you are sure you want to unsubscribe. Everything works perfectly except that clicking "Cancel" still submits the form. I can't use "onclick" in the submit button because it will bypass the captcha code. In my "if the email is true 'else'" statement I've tried both "return" and "return:false" but neither of them stop the form submission. Thanks for your help.

Confirm before delete

梦想与她 提交于 2019-12-12 03:21:07
问题 Below I want to confirm before deleting a record, problem here is whether I select ok or cancel from confirmation box record gets deleted on both, secondly I am not getting redirected to my required page after deletion. <script type="text/javascript"> function ConfirmDelete(){ if (confirm("Delete Account?")){ window.location='mains.php'; } else { // do nothing } } </script> if(isset($_POST['submit'])){ $que=$db->prepare("DELETE FROM blogs WHERE id = :id"); $que->execute(array(':id'=>$postId))

jQuery confirmation not working in Chrome

青春壹個敷衍的年華 提交于 2019-12-12 00:01:57
问题 I'm trying to create a basic confirmation box which prompts users with a simple confirm/cancel when they click on a link. This is working fine in FF and IE, however Chrome just seems to ignore it. Can anyone see why this might not be working? //Confirm Duplication $("a[href*=duplicate]").click(function(event){ var answer = confirm("Duplicate?") if(!answer){ event.preventDefault(); } }); Any advice appreciated. Thanks. 回答1: I was able to fix a similar issue by changing the initial jquery call

How to display a confirmation Modal with columns data on button click using Datatables

老子叫甜甜 提交于 2019-12-11 15:29:52
问题 Having the DataTable below, I would like to display a dynamic popup or modal whenever a button is clicked which will serve as a confirmation modal. The modal should contain data coming from the columns in the respected row in which the button was clicked. @section scripts { <script> $(document).ready(function() { var table = $('#visitorsTable').DataTable({ "ajax": { ... }, "columns": [ { "data": "FirstName" }, { "data": "LastName" }, { "data": "Email" }, { "data": "PhoneNumber" }, { "data":

Jquery confirmation not working

三世轮回 提交于 2019-12-11 12:30:08
问题 I tried this: https://stackoverflow.com/a/12617274/4164311. The string "Are you sure about this" just appears in my browser and nothing happens when I click the button. <html lang="en"> <head> <meta charset="utf-8"> <title>jQuery UI Dialog - Modal confirmation</title> <link rel="stylesheet" href="jquery-ui.min.css"> <script src="external/jquery/jquery.js"></script> <script src="jquery-ui.min.js"></script> <script> $("#dialog").dialog({ autoOpen: false, modal: true, buttons : { "Confirm" :

Conditional confirm prompt in asp.net code behind

旧巷老猫 提交于 2019-12-11 11:33:43
问题 I have looked around for a way of implementing this. Here is a pseudocode representation of what I have: bool hasData = ItemHasData(itemid); Confirm = "false"; // hidden variable if (hasData) { //Code to call confirm(message) returns "true" or "false" if (Confirm == "true") { //Delete item } else if (Confirm == "false") { return; } } The code to call confirm uses a asp:Literal control and sets it equal to the confirm. I can get the popup but only after the function exits. And it does nothing