Announcement Announcement Module
Collapse
No announcement yet.
Binding the "submit" field Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Binding the "submit" field

    I have a simple form with two buttons that submit the form. (using <input type="submit" value="button text"/>) Although the form handling should be the same regardless, I want to be able to respond differently depending on which button is pressed. How is the best way to access the "submit" value? I tried accessing it in request.getAttribute("submit"), to no avail. Should I bind it to a field in my Command? If so, how? Thanks very much for your help.

  • #2
    <input type="submit" name="explode" value="Boom!" /> :evil:

    request.getParameter("explode")

    Comment


    • #3
      check out this post

      http://forum.springframework.org/showthread.php?t=11086

      it describes some code that can be found
      http://lostinlondon.blogs.com/lil_te...ontroller.java
      and
      http://lostinlondon.blogs.com/lil_te...eResolver.java

      Like a basic form handler but it allows you to have different submission methods in the form handler depending on which submit button was pressed, the SubmitParameterPropertiesMethodNameResolver resolves a method name base on the name of the submit button pressed.
      Last edited by robyn; May 19th, 2006, 06:38 AM.

      Comment

      Working...
      X