Change your links launchingthe tickbox to another class, say
"thickboxDeleteImage". Remove the onclick code attached to your links. Stick
Something like this (untested) inside a script tag in the head of yur html
document:
$(document).ready(function(){
$(".thickboxDeleteImage").bind("click",function(){
If(confirm('delete image?')){
var t = this.title || this.name || null;
var a = this.href || this.alt;
var g = this.rel || false;
tb_show(t,a,g);
this.blur();
return false;
}
});
});
-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Angelo Zanetti
Sent: mercredi 27 juin 2007 15:07
To: [email protected]
Subject: [jQuery] Re: jQuery and confirm
Hi Alexander,
Do you have any idea of how I can build a wrapper for the confirm() box?
Thanks
Angelo
Alexandre Plennevaux wrote:
> It's because of the way cody's thickbox script is made: it does not by
> default give control on how the thickbox gets executed
>
> Your link gets thickboxed since it has the class="thickbox". You need
> to either build a wrapper function that articulates the thickbox
> together with the confirm() command.
>
> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED]
> On Behalf Of Angelo Zanetti
> Sent: mercredi 20 juin 2007 10:00
> To: [email protected]
> Subject: [jQuery] jQuery and confirm
>
>
> Dear All.
>
> I got a form and a link that has an onclick confirm:
>
> <a href="ajaxImage.php?height=480&width=600&modal=true" class="thickbox"
> style="text-decoration:underline;" onclick="return confirm('delete
> image?');">Delete Image</a>
>
> No matter if u choose ok or cancel (returns true or false) the link
> still gets executed. Im assuming that JQuery is causing this
> irregularity. I have the same code on normal HTML pages and it works 100%.
>
> Any suggestions as to how to get this to work or where i might be
> going wrong?
>
> Thanks in advance.
> Angelo
>
> Ce message Envoi est certifié sans virus connu.
> Analyse effectuée par AVG.
> Version: 7.5.472 / Base de données virus: 269.9.1/854 - Date:
> 19/06/2007
> 13:12
>
>
>
>
>
>
--
------------------------------------------------------------------------
Angelo Zanetti
Systems developer
------------------------------------------------------------------------
*Telephone:* +27 (021) 552 9799
*Mobile:* +27 (0) 72 441 3355
*Fax:* +27 (0) 86 681 5885
*
Web:* http://www.zlogic.co.za
*E-Mail:* [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
Ce message Envoi est certifié sans virus connu.
Analyse effectuée par AVG.
Version: 7.5.476 / Base de données virus: 269.9.10/873 - Date: 26/06/2007
23:54