Re-opening Browser With Confirm Box
Oct 28, 2007
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:
<script type="text/javascript">
function showalert(){
var conf = confirm("text here");
if (conf == true){
window.location.href = "http://www.nameofpage.com";
} else {
return true;
}}
</script>
View 1 Replies
ADVERTISEMENT
Jan 17, 2011
I am doing task for deleting cookies in javascript for IE and Mozilla. for that i written function is
Quote:
function deleteCookie(name, path, domain) {
if (getCookies(name)) {
document.cookie = name + "=" +
((path) ? "; path=" + path : "") +
[Code]....
Now , How i know whether my cookies get deleted or not.I am not sure whether my browser cookies are deleted or not
Is there any test is there from where i can confirm the same.
View 3 Replies
View Related
Nov 25, 2011
I have an popup which is an aspx page and when I click on browser close button..., the system should check if there is any unsaved data in the form or not. If there is any unsaved data then the message should be displayed (Do you want to leave..?) with OK and Cancel button... On click of the OK button, the data should not be saved and the user should be returned parent form ie popup should be closed and return to the parent form. On click of the cancel button, the control should return to the Pop.
I had tried the below code...
window.onbeforeunload = close;
function close() {
var result=confirm("Do you really want to close this window");
if (result) {
return true;
} else {
location.href = document.URL;
}}
The above code is not working i.e. the popup is getting closed even on click of close button....
and when clicked on OK it is displaying another msgbox with leave this page and Stay on this page buttons...
View 3 Replies
View Related
Jan 17, 2010
ok so here what i want to do:
i want a dropdown menu
i want a button (go)
i want ten different items in the dropdown menu
if i choose the first item and click go i want a new page to open in the same window
if i choose the second item and click go i want to a different page to open in the same window and so on
all ten items lead to a different link when i click go....how do i do this?
View 3 Replies
View Related
Feb 26, 2003
I have a question about opening new pages when a link is clicked on a webpage. What I want to happen is this:
On the main webpage, I would like to have links to other websites. For example:
Link 1
Link 2
Link 3
Now, if I was to click links 1,2 and 3, I would have 4 browser windows open: The window containing the original webpage, plus the 3 windows that were opened by clicking on the 3 links. (I am using a href="www.,,,,," target="_blank"></A>)
Now, what I want to happen is this, I only want the mainpage to have ONE child window so that at any given time, there will be at most 2 browser windows open, the main page window and one child that is opened by clicking on a link. If I click on Link 1 followed immediately by Link 2, I don't want 2 child windows to pop up. What I need to happen is when I click Link 1, it needs to open a window. When I click link 2, the browser window that contains the webpage from link 1 now needs to show the webpage that from link 2. Is there a way to do this using javascript window.open? Code:
View 1 Replies
View Related
Feb 28, 2003
I understand how it works, however, when pressing the open button to open the file, I'm getting a javascript error that says "Access Denied". Does anyone know how I can make it possible for a user to select a file and open it from my webpage? This would work great if it actually worked! Any ideas?
View 2 Replies
View Related
May 12, 2011
I want to open a new browser window using javascript. I don't want to display URL in the dialogue. Here is my code.
Code:
var windowFeatures = "top=100,left=100,scrollbars=yes,resizable=no,menubar=no,location=no,directories=no,titlebar=no";
var windowObjectReference = window.open(resourceURL,"_blank",windowFeatures);
The new dialogue shows the URL but doesn't allow to modify it. Is there any way to completely hide the url? Although I have specified resizable=no browser allows me to resize the window. I am using firefox.
View 3 Replies
View Related
May 10, 2011
say i have this url in my hand as a string, stored in a variable:http://img.youtube.com/vi/wgGh9RmO5vA/default.jpgi can copy and paste it to my browser manually and see a thumbnail.but how can i automatically open up a browser window and i see the thumbnail? without manually copying and pasting, i want to automaticallly open a broswer window with this string
View 5 Replies
View Related
May 12, 2011
I have a variable that I obtain from a php code. This variable contains a link such as http://.......
with this variable, say $a, once I obtain it with that php code, I want a browser window to open automatically.
View 4 Replies
View Related
Feb 3, 2010
My current project has me working with UI dialog and I was wondering if it's possible to open a new browser window from a click of the dialog button. I have set up an ajax call to get the url but I'm not sure if this is the correct way.
function createNewProject(irb_id){
jQuery.ui.dialog.defaults.bgiframe = true;
jQuery(function(){
jQuery('#confirmDialog').dialog({
[Code]......
View 1 Replies
View Related
May 12, 2011
I have a variable that I obtain from a php code. This variable contains a link such as http://.......with this variable, say $a, once I obtain it with that php code, I want a browser window to open automatically.I dont know javascript.
View 4 Replies
View Related
Feb 2, 2011
I am looking to have a link open a closeable window that is contained within a browser window. If you click on the "sizing charts" link on this website, this is exactly what I am looking to do:
[URL]
The window is contained within the current browser window, it can be dragged around, but not outside the parameters of the browser window.
View 2 Replies
View Related
Jul 23, 2005
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'
);
}
View 8 Replies
View Related
Jul 23, 2005
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)
}
}
I want to call this function on Unload.
View 3 Replies
View Related
Jul 23, 2005
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?
View 2 Replies
View Related
Nov 10, 2005
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.
View 2 Replies
View Related
Oct 13, 2006
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.
Has anyone else had an issue like this?
View 1 Replies
View Related
Jul 2, 2011
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].....
View 2 Replies
View Related
Apr 30, 2007
I have a link that I want when the user clicks on it a confirm pop-up to appear.
But it’s not working.
echo '
</td><td width="15%" bgcolor="'.$bg_color.'" align="center" class="update"><div class="update">
<a href="index.php?autoid='. $autoid .'" class="update" confirm("do you really want to delete")">DELETE</a></div></td></tr>'
View 6 Replies
View Related
Apr 14, 2009
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;
}}
View 2 Replies
View Related
Nov 13, 2003
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.
View 4 Replies
View Related
Oct 29, 2005
function del(type, id, title) {
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;
}}
PHP Code:
echo "<a href='#' onClick='del(a," .$result->getFieldByName('work_name') . ",". $result->getFieldByName('work_id') . "); return false;'>(Delete)</a></p>";
And finally the XHTML when I view source:
<a href='#' onClick='del(a,This is Another Test,38); return false;'>(Delete)</a>
... I'm getting absolutley no response. Ideas?
View 3 Replies
View Related
Sep 21, 2006
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" />
</form>
View 1 Replies
View Related
Jan 7, 2002
Basically, I'd like the code for a simple Confirm Dialog box.
My message is dynamic - I just want a confirmation box to appear when people click on a link which leads to a delete script.
I was wondering if people had both the <script> part and the <a> part to initialise the dialog box?
View 4 Replies
View Related
Jul 9, 2011
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.
View 4 Replies
View Related
Apr 10, 2006
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.
if not possible, how to write a simulated panel?
View 1 Replies
View Related