Bob Ippolito wrote:
> On 10/29/06, Dean <[EMAIL PROTECTED]> wrote:
>>
>> Hi everyone,
>>
>> What is the unobtrusive way to add a confirm dialog to an anchor? This
>> code doesn't quite work:
>>
>> /* Adds a confirm dialogue to elements */
>> function addConfirms()
>> { var e = getConfirmElements();
>> for( var c = 0; c < e.length; c++ )
>> { e[c].message = 'Confirm this?';
>> MochiKit.Signal.connect( e[c], 'onclick', confirmDialog );
>> }
>> }
>> function confirmDialog(evt)
>> { evt.stop();
>> if( ! this.message )
>> { this.message = 'Really?'; }
>> return confirm(this.message);
>> }
>>
>> Leaving out the evt.stop() clicks the link no mater what the confirm
>> return code is.
>
> if (!confirm(this.message)) {
> evt.stop();
> }
>
> -bob
Ah, thank you.
--Dean - Unscrambler of eggs
--
Take your time, take your chances
[3278.7 km, 273.4] Apparent Rennerian
------------------------------------------------------------------------------
It matters not how strait the gate / How charged with punishment the scroll
I am the master of my fate / I am the captain of my soul. -- Invictus --
-- William E Henley --
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"MochiKit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/mochikit
-~----------~----~----~----~------~----~------~--~---