Jump to content


Photo

Dialog Box


  • Please log in to reply
6 replies to this topic

#1 joecooper

joecooper
  • Members
  • PipPipPip
  • Advanced Member
  • 358 posts

Posted 28 March 2006 - 05:12 PM

How can i add a dialog box via a link. Pressing Yes will goto another page - and no will just close the box and not do anything?
Signature:
[/a]
[a href="http://www.planet-so...=1999&lngWId=8" target="_blank"]EzLogin 1.0[/a]
[a href="http://www.essexracers.com" target="_blank"]Essexracers.com[/a]
Msn Messenger: joe@joeyjoe.co.uk

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 28 March 2006 - 05:34 PM

This is a javascript question really but... something like...
<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>


#3 joecooper

joecooper
  • Members
  • PipPipPip
  • Advanced Member
  • 358 posts

Posted 28 March 2006 - 05:41 PM

Thanks

does anyone have a working version of this?
Signature:
[/a]
[a href="http://www.planet-so...=1999&lngWId=8" target="_blank"]EzLogin 1.0[/a]
[a href="http://www.essexracers.com" target="_blank"]Essexracers.com[/a]
Msn Messenger: joe@joeyjoe.co.uk

#4 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 28 March 2006 - 06:14 PM

[!--quoteo(post=359362:date=Mar 28 2006, 06:41 PM:name=joecooper)--][div class=\'quotetop\']QUOTE(joecooper @ Mar 28 2006, 06:41 PM) View Post[/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:

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


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

hope it helps tho
Mark
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#5 joecooper

joecooper
  • Members
  • PipPipPip
  • Advanced Member
  • 358 posts

Posted 28 March 2006 - 07:00 PM

thanks, but also doesnt work.
Signature:
[/a]
[a href="http://www.planet-so...=1999&lngWId=8" target="_blank"]EzLogin 1.0[/a]
[a href="http://www.essexracers.com" target="_blank"]Essexracers.com[/a]
Msn Messenger: joe@joeyjoe.co.uk

#6 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 28 March 2006 - 07:46 PM

(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.
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#7 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 28 March 2006 - 08:28 PM

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.

Info: PHP Manual





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users