Google for the preventDefault method of a javascript event.

For instance, assuming

<a jwcid="[EMAIL PROTECTED]:AjaxLinkSubmit" updateComponents="ognl:{'tableSection'}" listener="listener:search"><span key="search">Search</span></a>

add
document.getElementById('search').onclick= function(e) {
   if (!confirm('message')) e.preventDefault();
}

or

dojo.event.connect(dojo.byId('search'), "onclick", function(e) {
 if (!confirm('message')) e.preventDefault();
});



Martin, Charles-Andre wrote:
Hi,
First, I would like to say thanks for all the jobs you've done. Tacos is a great framework ! Nevertheless, I need help with a confirm message problem. I would like to display a javascript confirm message when the user click on a link. If the user click OK, then I would like to send an AJAX event to the server. If the user click on the cancel button, I would like to stay on the page. I've read and tried the Are You Sure ? example in the EnjoyWebDevWithTapestry.pdf book, but it doens't work. Indeed, when I register my confirm function with dojo on the onclick event, it still send the request when the user click on the cancel button. I also tried to use an AjaxEventSubmit component. But, I can't get the generated javascript function name using the AjaxEventSubmit.getFunctionName() method. Futhermore, I tried this :

<a jwcid="[EMAIL PROTECTED]:AjaxLinkSubmit" updateComponents="ognl:{'tableSection'}" listener="listener:search" href="#" class="aRedFilter" onclick="return confirm('message:deleteMessage');"><span key="search">Search</span></a></td>

But the request is send if the user click on the ok and the cancel button

Although I've read some people faced the same problem on the mailing list, I couldn't find a solution.

Thanks for the help !

Charles-Andre Martin
------------------------------------------------------------------------ "Ce message est confidentiel, a l'usage exclusif du destinataire ci-dessus et son contenu ne represente en aucun cas un engagement de la part de AXA, sauf en cas de stipulation expresse et par ecrit de la part de AXA. Toute publication, utilisation ou diffusion, meme partielle, doit etre autorisee prealablement. Si vous n'etes pas destinataire de ce message, merci d'en avertir immediatement l'expediteur."

"This e-mail message is confidential, for the exclusive use of the addressee and its contents shall not constitute a commitment by AXA, except as otherwise specifically provided in writing by AXA. Any unauthorized disclosure, use or dissemination, either whole or partial, is prohibited. If you are not the intended recipient of the message, please notify the sender immediately."


-------------------------------------------------------
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
_______________________________________________
Tacos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tacos-devel

Reply via email to