anyone know how to pop up a confirm window with (Y) & (N)? I want to pop up a "Do you want to continue?" message box (javascript only, can't use vbscript) with (Y) & (N). when click (N), then close the current window. If click (Y), then back to server side to continue. Is it possible?
is there anyway to make certain text in the confirm window, the one what comes up when i call confirm(text) in javascript? I'm displaying a message in the confirm window to the user and wanted to make certain text bold.
I am having some difficulty in constructing a window.confirm() function that works with my code.So if the form data is valid, I need to use a window.confirm() dialog box to show the user's total cost based on the rental rate of equipment chosen and the reservation period. The user must accept the cost by pressing the confirm button, and if user cancels do not submit data.I have written this code but cannot figure out how to find the number of days from the 2 date fields and use that to calculate and display the total cost.
//confirm submit and display rental cost var equip = document.forms[0].equipment.value var pDate = document.forms[0].pickupDate.value[code].....
is there a way of changing the values of the confirm box from ok / cancel to yes / no
i have the following alert/confirm box but it is worded in a way that the ok and cancel do not make sense:
function confirmNewSupplierWelcome(){ return confirm( 'Before going on to request a new supplier ' + 'are you sure there is no suitable alternative?' + ' Remember, new suppliers are authorised by exception only' ); }
Is there anyway to display a confirm msg onUnload of a page?
I mean to say if iam calling onUnload=javascript:check();
and in check(){
if(confirm("check?")) { unload the page; } else { Dont unload , just come back to the previous state( i have some values in text fields to be retained) } }
This is a weird one and I am wondering if someone can help?
I have a piece of Javascript function deleteRequest(searchID) { if (confirm('Are you sure?')){ location = "index.php?spDB=inactive&searchID="+searchID; } }
When the page gets reloaded, it runs a database query and something is made inactive.
The problem is:
When the confirm box appears, if I press OK quickly, the database query doesn't happen. If I wait 1 second and then press OK, it is fine and the query is run.
Basically it appears that the time between the confirm javascript appearing and the time taken to press the Ok button affects the reloading of the page.
when my page loads it starts with a confrim box. If "Cancel" is selected then the rest of the page loads fine. If "Ok" is selected nothing after the confirm box loads.Also, it appears that IE and Firefox have trouble with this type of media and Chrome will only play the audio file for about 15 seconds.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head>[code].....
I need to give two separate alerts depending on what the user clicks when they click the "Submit" button. I am using a confirm box. If they click "OK" it thanks them for their order. If they click "Cancel" it should go back to the form. I have written the code that I thought would work but it will not.
function confMsg(){ var s s = confirm("Click OK to Submit Order. Click Cancel to Cancel") if (s=="true"){ alert("Thank You for Your Order!") else return; }}
How would I go checking if a certain submit button was pushed and if so confirm the user if he is sure. But if he pushes cancle, then it will cancle the operation.
if (confirm("Are you sure you want to delete '" + title + "'")) { window.location.href = 'http://www.example.com/delete.php?t=' + type + '&id=' + id; } else { return false; }}
I have created a form with two submit button “Delete and Edit” in the form I have a javascript code, that displays a confirm box when the delete button is clicked, clicking on cancel should stop the execution of the delete script and ‘ok’ should run the script. Now, using the form this way works perfectly in Mozilla fireworks, but IE posing a problem when I click on cancel, it still executes the delete script.
<form method="post" action="eddel.php" > <input type="submit" value="delete" name="delete" onclick=”return confirm(‘are you sure you want to delete record?’)”;> <label> <input name="edit" type="submit" value="edit" />
the total number of grades and the sum of the grades. Your program will ask a user to input a number grade (assume the user enters a number between 0-100) if the number grade is greater than 90 set your letter grade = A, >=90 = A>=80 = B>=70 = C<70 = FFor each grade entered add the number grade to your sum. output each number grade and letter in a sentence and on a separate line for example if the user entered 95, you would output 95=Aafter each grade is entered ask the user if they would like to continueif the user doesn't wish to continue, output the sum of grades, the number of grades entered, and the average (all on separate lines) with the values in BOLD.
Let's say I want to remove/insert one button in the popup panel of the confirm function, or change the text of the button (ex. "ok" rename to "pls try again"); and also change the background of that panel.
I've found articles/posts on creating custom confirm pops utilizing hidden <div> etc, but adding 40 odd lines of code just to offer Yes or No buttons seems absurd. Short of creating a complete confirmation div and script, is it possible to EASILY change the button values of a confirmation pop-up? For Example, "There is a related value not selected in the form. Would you like to select it now?"
I'm new to Java Script and I'm having trouble getting something done. What I'm trying to do is have a confirm box open when the user closes the web page that asks a question. If the user clicks cancel, then the page stays closed. On the other hand, if the user clicks OK, then a page opens. The problem is, I have no problem getting it to work if the user "unloads" the page by using a link to another site, but I don't know if it is possible to use java script to re-open the browser, and then open it to a specific page if the user unloads the page by closing the browser.
My logic says it's not possible. Java script works in the browser, so how can it do anything once the browser has been closed? Am I right? If not, can you show me how to edit the code to make it work? Here's what I have so far:
I need to confirm the forms on my web page but I need it in a particularly way I need that when I make send the forms that I didnt fill up have a text down of each one that said that it didnt fill up
To confirm that a CMS user really wants to delete a record, I have added some Java Script that was originally intended to confirm if a user wants to visit a new web page that takes a long time to download. The script provided two location.replace() options: 1) to visit the new page or 2) to return to the previous page. I want to modify it so that the options are 1) to continue on to the following deletion script or 2) reurn to the previous page. How do I set up option 1) to do this in the following script? Probably something else than location.replace().
Right now I have option 1) set to direct the user to the same deletion page where this script resides. But this will just loop the user back thru the same JavaScript. Again, I want the first option to just allow the user to continue on thru the rest of the deletion script. Code:
I have never done any javascript at all but I think it can do what I want with ease.
Basically at the moment I have a link that calls a delete script written in php. The delete script just deletes and item from my mysql database. What I would like is a popup to appear when the link is clicked that asks for the user to confirm they wish to delete.
Could anyone either show and example or point me to a site that may have a tutorial or something.
I currently have the follwoing javascript function: Code:
/** * ask question, if true goto X */ function watsConfirmAction( question, letsgoto ) { // ask question if ( confirm( question ) ) { // on YES goto location location.href = letsgoto; } } which is used as follows:
If a user doesn't have javascript, for whatever reason, this will fail to send them anywhere. is there a better way of doing this to allow for javascript non compliant browsers?
First off I'm using a combination of PHP/MySQL/javascript for this code just as a heads up. I have a form that will delete information from my database. I would like to have a confirm() dialoge box appear to verify they truely would like to delete this information. If the confirm is true then I want it to redirect to a *.php that will execute the script, else if the confirm is false I want it to return false and do nothing. (close the dialoge box and take the user to the page they just requested the deletion from). I've searched for hours trying to get this and I think I'm close but I just can't seem to get the false confirm to work. Code:
I'm developing in .NET, so my form's submit button is created by the framework, not me. .NET automatically controls the submit buttons onClick attribute. So it's not real easy for me to just pop in "return confirm('whatever');" in front of the script that .NET has put in there. (I've read some articles, and it's pretty much a bug in the current version of .NET)
If you scroll down to the last post on this page and read a post by Mike Moore, it explains a workaround for sharing the onClick attribute with .NET.
Now, my problem: Unlike, Mike's example, I'm wanting to get a confirm, but I don't know how to have JavaScript "listen" for the return without putting it directly into the onClick -- which I can't do.
This is what I have at the moment (running of the page onload event):
Code:
var OldClick;
function window_onload() { OldClick = document.forms[0].BackButton.onclick; document.forms[0].BackButton.onclick = MyClick; }
function MyClick() { if (confirm('This will NOT submit any changes you've made to Customer Information. If there are changes to be saved, click CANCEL and use the "Subit Changes" Button. Otherwise, click OK to return to the Ticket.')){ if (typeof(OldClick) == 'function') OldClick(); } else { /* do nothing */ } } The problem is that it doesn't listen for any return, and executes the function OldClick() everytime...
I've tried things like this (and many variations), but I guess I don't know what I'm doing, because it doesn't work:
Code: function window_onload() { OldClick = document.forms[0].BackButton.onclick; document.forms[0].BackButton.onclick = "return MyClick();" } Can anyone help me with this?