Marco Mariani wrote: > Christopher Arndt wrote: > > Suren schrieb: > > > >> If I have multiple buttons on a form, how does the controller which > >> button has been clicked? I can send all submits to one controller > >> method but how to determine which of those four buttons were clicked? > >> > > > > BTW, for the most common case, where you want a submit and a cancel button, > > you > > can just put a link instead of the cancel button, that references another > > url > > than the form action, and then make it look like a button with CSS: > > > If you do that, be sure your "fake" button does not cause writes to a DB > or something like that... we're not supposed to change the state of a > server application upon using a GET method on an URL. There are several > caching-plugins, extensions and spiders that happily open every link > they see on a loaded page without user action, and in that case they > would change or delete data on the server.
IIRC basecamp (made by the Ruby on Rails team) had this problem when google's web accelerator went click-happy and deleted a bunch of stuff. Moral: Even on a restricted site you should beware of this kind of thing. You can restyle links and buttons so one looks like the other, that is pretty much always a better solution than using one instead of the other. -Adam --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "TurboGears" group. To post to this group, send email to turbogears@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/turbogears?hl=en -~----------~----~----~----~------~----~------~--~---