Javascript Confirm Popup.

Jul 21, 2005

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.

View 6 Replies


ADVERTISEMENT

Alert Box Popup To Confirm Before Deleting Entry?

Jan 25, 2010

I am working on a PHP web application for my company and have run into a problem with Javascript. In a list I am displaying from a Mysql database, I have the option to delete certain entries. Before someone deletes an entry though, I want them to have an alert box pop up and asked then if they are sure. I have this simple javascript function in the head of the page, but whether cancel or ok are pressed, the page refreshes to the link. How can I fix it so that if you press cancel, nothing happens, other then the alert box goes away, but also allows the link to process if OK is pressed?

HTML Code:
<script type="text/javascript">
function show_confirm(){
var r=confirm("Press a button!");
if (r==true){
alert("You pressed OK!");
}else{
alert("You pressed Cancel!");
}}
</script>

View 7 Replies View Related

JQuery :: Popup Script Confirmation On Clicking Accordion Header To Confirm Change Of Section?

Oct 5, 2010

Is there any way to popup a javascript confirmation on clicking an accordion header to confirm the change of section?

View 3 Replies View Related

Javascript And Confirm

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

Javascript Confirm Box

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

JavaScript Confirm -> Goto

Jan 16, 2006

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:

HTML Code:

<a onClick="watsConfirmAction('ask question', 'some URL')">link</a>

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?

View 3 Replies View Related

Need To Cancel A Javascript Alert/confirm Box

Jul 23, 2005

A description of the problem:
1) Go to a page with various settings and a timeout (forces re-login
if over 10 minutes)
2) Before the timeout, make some changes to settings.
3) Press a "reset to defaults" button that uses a confirmation box to
let the user know what is about to be reset (lists items).
4) Walk away while the confirm box is displayed and come back after
the page timeout.
5) My screen now has the page, a confirm popup on top of that, and a
timeout alert on top of that.
6) Press OK to dismiss the timeout alert. The underlying page goes to
the login screen, but the confirm box remains.

How can I clear any javascript alert/confirm popups in this situation
automatically?

View 7 Replies View Related

Can A Hyperlink Call A Javascript Confirm Prompt?

Mar 17, 2006

Hi, I have this JavaScript, which I only want to occur if a user clicks on a
hyperlink hotspot in a large image:

<script type="text/javascript">
<!--
var answer = confirm ("This link is not available, click OK to load a
similar link, or Cancel to not.")
if (!answer)
window.location="http://www.yahoo.com/"
// -->
</script>

To make matters more challenging, there are about 10 hotspots in the image,
and I want them each to have a different value for window.location. I.e. if
the user clicks OK in each hotspot, each one will redirect them to a
different site.

View 17 Replies View Related

Javascript Alert/Confirm Dialogs And I18N

Apr 3, 2006

I'm pretty sure after reading this board and many like it that it is
impossible to change the ok, ok/cancel buttons that appear by default
in the alert and confirm javascript dialogs. Now for question one why
not? And question two why do they still say ok and ok/cancel when
viewed in a non-english browser install?

I have installed Chinese IE 6.0 and these buttons still say Ok/Cancel.
the rest of the browser (buttons, menus, etc...) is in Chinese except
for these two stupid buttons. No one final question, whould having a
reginonal OS installed make any difference. Right now I'm using an
English OS but with the Chinese browser mentioned above.

View 1 Replies View Related

JavaScript Popup

Sep 19, 2003

I have a Popup on my website which appears the first time someone leaves my home page. The problem is that it's intended for people who decided not to order, but it still appears when visitors go to my order page. Please can you tell me how to stop this happening, so that it only appears when people click away to a page other than my order page? Code:

View 1 Replies View Related

Modal Popup Javascript In Asp.net

Jul 23, 2005

I'm trying to creat a modal dialog box in asp.net using the following

Dim str_JavaPopup As String = "<script language" &
"='javascript'>window.showModalDialog('frm_MoreInfo.aspx?ProductI mage="
& str_ImageName & "&ProductDesc=" & str_Description & "','dialogWidth:
100px;dialogHeight: 100px;center: yes;resize: no;status: no;help:
no');</Script>"

Me.Page.RegisterStartupScript("Startup", str_JavaPopup)

the window opens fine but the window does not resize

is my code ok?

View 1 Replies View Related

JavaScript Popup Effect

Feb 8, 2007

I'm after creating a JavaScript effect on my site. I've just created a basic popup effect on the Loughbourgh Image which when clicked brings up a popup (which for some reason only works in IE at the moment). However this is static. What i want is whenever i hover over that image the popup appears but in relation to the cursor. So if the cursor moves the pop moves along with it.

I assume there is an effect such as this but i have had no luck finding it so can someone point me in the right direction please? Is there any similer posts regarding this subject or a tutorial i could learn from?

View 11 Replies View Related

Opening Javascript PopUp From Within PHP Code

Jul 23, 2005

I've been trying to do this for days without success. Is there a way to open a popup window from within the php code? Example:

if (some_condition) {
open a popup page and load a file in it
break;
}

View 2 Replies View Related

Javascript Popup View By Details

Jul 23, 2005

I have a very simple javascript popup that opens to a drive folder, e.g.

c: est

which is called as such:

<A HREF="javascript:popUp('C:/test')">Test Folder</A>

This displays the contents of the c: emp folder
but defaults to a view of "large icons." Is there
a way to make it default to a view of "details?"

View 4 Replies View Related

Javascript Info Popup On Highlight

Dec 17, 2006

I've seen this effect on other sites, but I don't know how to do
it. What I'm trying to do is enable the user to highlight a portion of
text on a webpage, then click an "edit" button and a little window will
popup with that highlighted text in an editable mode (or it could be
the entire paragraph tag that the highlighted text sits in). Then I
want them to be able to edit the text however they want, click a "save"
button, and the text updates within the webpage. I know how to do the
last part of this, but I don't know how to make the popup window work
and include the highlighted text.

Just a little background on this project: What I ultimately want to be
able to do is let the website's owner be able to update the contents of
her site whenever she wishes. This is what she wants because she
doesn't know html and doesn't want to learn it. She also doesn't want
to learn dreamweaver or any other wysiwyg editor. I would almost guess
that a similar project exists out there already, maybe not using
javascript, but I haven't been able to find it. Code:

View 2 Replies View Related

Javascript Popup W/php Form Processing.

Apr 5, 2001

i have a form like this on a page called emailform.htm:

<form method="post" onSubmit=NewWindow()>
<H3>From: <input type="text" name="from"></H3>
<H3>Message: <input type="text" name="body"></H3>
<input type="submit" value="Send the Message">
</form>

when submitted, it calls this function:

function NewWindow(){
window.open('sendmail.php', 'newWin', 'scrollbars=no,
toolbar=no, width=200, height=200');
}

two problems:

1. the form values are not getting passed over to sendmail.php.
2. after the popup window pops up and loads sendmail.php, the original page, emailform.htm, changes to an error page.

so, what do i need to do to get the form values to be passed, and how do i keep the original page either from changing at all, or, if thats not possible, get it to simply reload itself.

View 3 Replies View Related

Javascript Popup Error - Opera Only

Sep 8, 2001

I have a site which uses a javascript fullscreen popup window which launches from the splash page (as well as a standard browser version for those with non-compliant browsers). All works well on both Netscape and IE, but if you're using Opera and you click on the "All other browsers" version, you get both the browser version and the popup version. This will probably be very irritating to Opera users. Unfortunately, I can't just program the popup for Opera compliance as well because it won't do fullscreen - it nests under the ad/control bars. Could someone look at it in Opera and maybe suggest a solution? Opera users don't make up a lot of my user base but I really prefer to be Opera-compliant.

View 7 Replies View Related

Javascript Popup Menu Problem

Mar 30, 2006

I have this irritation problem that i cnt sort out. I jave a menu on my website that uses javascript popup menus on mouse over.

But now the problem is that wen the menu appears, it is behind the dropdownlist on the site that is under the menu. This only hapens in IE and works fine in firefox. It does the same things with flash banners.

View 2 Replies View Related

Javascript Anthology Popup Query

Apr 20, 2007

I have used the code from Sitepoint Javascript anthology (page 130) to create a popup on my pages, however I have a list of pdfs each of which needs to open in a popup and the code only works with the very first in the list. the rest of the pdfs open up in the window as normal. How can I adapt this and would I have to separatly number each id: ?

View 1 Replies View Related

Javascript/html Popup Crash Firefox?

Jul 28, 2005

I'm having some trouble implementing a popup in firefox. I attached some
simplified code at the bottom. This is part of a firefox extension. What
happens is that a popup window is created, the popup window updates it's
data depending on what is shown on the main window. The problem comes when i
click the 'X' to close the popup window. it crashes firefox, and closes all
firefox windows. can somebody help me with this? why does this happen? I'm
99% sure the error comes from the form in the html code.

window.getNode = function (t)
{//stuff}

window.printNode = function (node)
{//stuff}

window.updateWindow = function (num, tag, inner) {
outputWindow.document.outputForm.nodeNum.value = num;
outputWindow.document.outputForm.nodeTag.value = tag;
outputWindow.document.outputForm.innerHTML.value = inner;
}

//popup
window.outputWindow = window.open('', 'outwindow', 'width=500,height=500');

//add contents to window
outputWindow.document.write("<html><body><form name='outputForm'>Node
number:<input type=text size=20 name='nodeNum' value=''><br>Node tag:<input
type=text size=10 name='nodeTag' value=''><br>Inner HTML:<input type=text
size=50 name='innerHTML' value=''></form></body></html>");

document.onmouseover = getNode;

View 3 Replies View Related

Auto-sizing Of Popup Window In JavaScript

Jan 28, 2001

I have a page where users click on a small thumbnail image to view a larger version of the image in a new window. But instead of just viewing the image file, I want them to view an HTML page that contains the image and a "Close Window" button. I know how to do that, and I know how to specify the size of the popup window. But...

What I'm trying to do is make the popup window just big enough for the image and the button, with perhaps a 10 pixel border around it. Since the images will vary in size, I can't hard code the width and height properties of the popup window. I need to have JavaScript measure the height and width of the image to calculate the dimensions for the popup window (and presumable this would have to be done before it opens the new window).

View 12 Replies View Related

Refreshing Main Page From Popup With Javascript

Sep 16, 2001

I have a normal web page that contains a link.

When the link is pressed a javascript popup window occurs asking the user for a choice.

The popup window then closes and I want also for the original page to be refreshed.

So how do I do the refreshing is my question.

I realise the reload command is relevant, but am unsure on how to tell the pop up window to refresh the original page.

View 1 Replies View Related

How To Create A Frameless Modal Popup Window Using Javascript?

Jun 1, 2007

I am just wondering how to create a modal popup using javascript. The
popup window shouldnt contain minimize,close and maximize buttons and
it should be resizable? I am trying using window.open but not getting
the desirable results.

View 1 Replies View Related

Refreshing The Parent Window When A Popup Closes Using Javascript??

Oct 13, 2003

i have a popup from the parent window which allwos the user to add in new location. when the lcoation has been added succesfully. then thewindow closes and the parent gets refreshed. In particular, just the location listbox gets updated with the new value. the location listbox i generated from the database using asp.

View 2 Replies View Related

Javascript Alert / Popup Query On Deleting Records...

Dec 27, 2007

On some sites I have worked on, users can delete content from their site. When they go to delete an item, I take them to a page where I pull the item details of the item they are about to delete from the dbase, and say "Are you sure you want to delete so and so". They can choose Yes / No. Yes takes them to action that runs the SQL to delete the item from the dbase. No takes them to the previous page.

I have seen some sites that have managed this process differently, where, instead of being taken to another page, a little pop up box opens saying "Are you sure", with a Yes / No option on it. Yes takes you to delete the item, No leaves them on the page they are on.

Am I right that this method uses Javascript? I know that it won't work if javascript is turned off, but - most people don't turn it off...

View 7 Replies View Related

JavaScript Popup On Window Close: Works Great On IE, Works Terribly On FF

Dec 13, 2006

I'm just restating my "site abandonment" post but with a clearer title as I realized it probably only made sense to me and me alone.

I have window that pops up with our commerce system. I have it set to pop up a window via JavaScript if the visitor quits early in the process (abandons the commerce system before completing all of the steps. The new popup is just a customer survey ("why are you leaving, is there something else we can help you with" etc. etc.).

Here's the problem, it works fine in IE, but in Firefox, anytime the page in the original commerce window is changed, refreshed or advanced to a new page, the survey popup window is called rather than just on window close.

Again, here's the two JavaScript routines that handle clicks on the graphical close button and on the window 'X' close button. Code:

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved