Skip to main content
Known Participant
May 20, 2009
Answered

A form with more than one submit button

  • May 20, 2009
  • 1 reply
  • 569 views

Hi,

I have a very long form. What I would like to so is add an extra submit button so the user can just change the image if they want.

- is it possible to have more than one form on the page. If so how do I determine which form is submitted isDefined('form1'), isDefined('form2') does not seem to work,

- if there are two buttons in the form how can I tell which one was preses as both seem to return true when tested with isDefined()

Thanks

    This topic has been closed for replies.
    Correct answer mack_

    - is it possible to have more than one form on the page. If so how do

    I determine which form is submitted isDefined('form1'),

    isDefined('form2') does not seem to work,

    Yes.

    - if there are two buttons in the form how can I tell which one was

    preses as both seem to return true when tested with isDefined()

    Give the buttons different name attributes. On your action page check

    with StructKeyExists(Form, "name_of_first_button") and

    StructKeyExists(Form, "name_of_second_button") which one was pressed.

    Mack

    1 reply

    mack_Correct answer
    Participating Frequently
    May 20, 2009

    - is it possible to have more than one form on the page. If so how do

    I determine which form is submitted isDefined('form1'),

    isDefined('form2') does not seem to work,

    Yes.

    - if there are two buttons in the form how can I tell which one was

    preses as both seem to return true when tested with isDefined()

    Give the buttons different name attributes. On your action page check

    with StructKeyExists(Form, "name_of_first_button") and

    StructKeyExists(Form, "name_of_second_button") which one was pressed.

    Mack

    HulfyAuthor
    Known Participant
    May 20, 2009

    Nice one Mack. Clear and concise.