Jump to content

Dialog Box


joecooper

Recommended Posts

This is a javascript question really but... something like...
[code]
<script language="JavaScript">
<!--
function ask() {
  in = confirm("Are you sure?");
  if (in == true) {
    window.location="http://redirect.php";
  }
}
-->
</script>

<a href="#" onclick='ask()'>click</a>
[/code]
Link to comment
Share on other sites

[!--quoteo(post=359362:date=Mar 28 2006, 06:41 PM:name=joecooper)--][div class=\'quotetop\']QUOTE(joecooper @ Mar 28 2006, 06:41 PM) [snapback]359362[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Thanks

does anyone have a working version of this?
[/quote]

Hi

i have this implemented in a different way attached to a form button, but it will work with links (<a>), etc too:

[code]
<input name="Submit" type="submit" value="Delete" onClick="return confirm('Are you sure you want to delete this record?');" />

[/code]

but thorpe's right, this is more of a javascript thing not php

hope it helps tho
Mark
Link to comment
Share on other sites

(mods - apologies for bumping a thread in a php forum that should be in JS)

joecooper, the code I provide and also what thorpe provided does work, but how you use it might be the problem. answer me this - what did you try the 'onclick' method on? an <a href .... > link or a button?

please can you post the code that you tried.
Link to comment
Share on other sites

To all concerned: this is a Javascript question. I have moved it here because of that. I have also renamed the thread because that's a ridiculous title and provides no meaning. joecooper, you're being warned.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.