struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Using html:button with Javascript
Date Sat, 06 Apr 2002 19:54:54 GMT

I'm using several buttons on a form, an update, a delete, and a cancel.  I
use the property 
of each button to determine which action needs to be taken. I added some
javascript to the 
delete like:

          <html:button value="Delete" property="DeleteButton" 
            onclick="javascript:if(confirm('Click OK to delete the region'))
submit();" />

Obviously I've done this to keep records from accidentally being deleted.
Problem is, since I'm
using the submit() function to start the action, I no longer see the button
value.  Temporarily
I've fixed this by assuming a null name is the delete.  This is ok until you
just press a return key
while in the form.  This also gives a null name and deletes the record
(which is rather rude!)  
Anybody know a good way to work around this?

Thanks, Mike

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message