You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by James Reynolds <Ja...@ihc.com> on 2005/10/25 01:40:43 UTC

x:commandLink and onClick

I'm trying to add some confirmation to the onClick event for my
commandLink.  The mail archives have good suggestions including:
 
1. Call a function defined on the page like this: onclick="return
validate()"
2. Construct the javascript as such: onclick="if (!confirm('Are you sure
you want to delete this record?')) return"
 
In each case, I'm receiving "Object Expected" errors in Internet
Explorer.  What is the best way of handling this task?
 
Thanks

Re: x:commandLink and onClick

Posted by Marius Kreis <ma...@nulldevice.org>.
This sounds like an error in your javascript.
Perhaps you should try
onClick="return confirm('Are you sure...?');"

James Reynolds wrote:
> I'm trying to add some confirmation to the onClick event for my 
> commandLink.  The mail archives have good suggestions including:
>  
> 1. Call a function defined on the page like this: onclick="return 
> validate()"
> 2. Construct the javascript as such: onclick="if (!confirm('Are you sure 
> you want to delete this record?')) return"
>  
> In each case, I'm receiving "Object Expected" errors in Internet 
> Explorer.  What is the best way of handling this task?
>  
> Thanks