[Zope] two submit buttons/ one method

John Hunter jdhunter@ace.bsd.uchicago.edu
Wed, 08 May 2002 21:22:10 -0500


I have a form with two submit buttons.  Rather than call two different
methods as in 

  <form action="" method="post">
    ...
    <input type="submit" name="some_func:method" value="Button 1">
    <input type="submit" name="some_other_func:method" value="Button 2">
  </form>

I would like each button to call the same function, but with a
different value for a variable.  Something like:

  <form action="" method="post">
    ...
    <input type="hidden" name="somevar" value="someval">
    <input type="submit" name="some_func:method" value="Button 1">
    <input type="hidden" name="somevar" value="someotherval">
    <input type="submit" name="some_func:method" value="Button 2">
  </form>

But this doesn't work.

Any suggestions?
Thanks,
John Hunter