Oh! That's a good idea. However, that presents another problem for my page. By way of some background, I'm using a dataTable to build a list of upcoming conferences. The final column contains two links inside, "Edit" and "Delete." The Edit navigates to a detail page, while the delete would obviously remove the record and reload the page. I also have an "Add Conference" button outside of the table. Using the onSubmit attribute would prompt for confirmation no matter what control is activated. Perhaps I should just use commandButtons instead of commandLinks and avoid the issue altogether.
-----Original Message----- From: Marius Kreis [mailto:[EMAIL PROTECTED] Sent: Tuesday, October 25, 2005 8:26 AM To: MyFaces Discussion Subject: Re: x:commandLink and onClick sorry, my mistake. i think <h:form onSubmit="return confirm('text');" ..> should work.... James Reynolds wrote: > That was my first try. The confirmation box pops up properly, but the > form does not submit after clicking the 'OK' button. Has anyone else > had this trouble? Judging from the archives, it appears that people > have had mixed results with different methods. > > -----Original Message----- > From: Marius Kreis [mailto:[EMAIL PROTECTED] > Sent: Tuesday, October 25, 2005 7:32 AM > To: MyFaces Discussion > Subject: Re: x:commandLink and onClick > > 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 > > > >

