can a form have

Discussion in 'HTML' started by diablo, Jun 22, 2005.

  1. diablo

    diablo Guest

    Hi

    Can a form have multiple submit buttons that send it to different pages.

    so if i press submitA it goes to pageA.asp
    if i ress submitB it goes to pageB.asp

    Thanks

    D
     
    diablo, Jun 22, 2005
    #1
    1. Advertising

  2. David Dorward, Jun 22, 2005
    #2
    1. Advertising

  3. diablo

    Mark Parnell Guest

    Previously in alt.html, diablo <> said:

    > Can a form have multiple submit buttons that send it to different pages.
    >
    > so if i press submitA it goes to pageA.asp
    > if i ress submitB it goes to pageB.asp


    Yes. Just set your script that processes the form to send the user to
    the appropriate page, based on which submit button was pressed.

    --
    Mark Parnell
    http://www.clarkecomputers.com.au
    alt.html FAQ :: http://html-faq.com/
     
    Mark Parnell, Jun 22, 2005
    #3
  4. diablo

    Toby Inkster Guest

    diablo wrote:

    > Can a form have multiple submit buttons that send it to different pages.
    >
    > so if i press submitA it goes to pageA.asp
    > if i ress submitB it goes to pageB.asp


    No. But what you *can* do is submit the form to one single page that
    checks to see what button was pressed and then redirects the user to
    pageA.asp or pageB.asp.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Jun 22, 2005
    #4
  5. diablo

    Noozer Guest

    "diablo" <> wrote in message
    news:B28ue.107$...
    > Hi
    >
    > Can a form have multiple submit buttons that send it to different pages.
    >
    > so if i press submitA it goes to pageA.asp
    > if i ress submitB it goes to pageB.asp


    No. Only one "SUBMIT" button per form.

    You CAN use scripting to alter the behaviour of a form though. Create
    multiple buttons with an ONCLICK event in each that does the modification.
     
    Noozer, Jun 22, 2005
    #5
  6. Noozer wrote:

    <snip>
    > No. Only one "SUBMIT" button per form.

    <snip>
    Ah no, you can have more that one submit button to a form, it become and
    array element just like any other form field in a form with the same
    name attribute.

    Yes, you cannot change a form's action by which submit button was press
    without client-side scripting, but as Toby suggests a common receiving
    cgi scripted page can either redirect or adjust its processing based
    upon the value of the specific submit button clicked.

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Jun 22, 2005
    #6
  7. diablo

    NSDesign Guest

    > Can a form have multiple submit buttons that send it to different pages.
    >
    > so if i press submitA it goes to pageA.asp
    > if i ress submitB it goes to pageB.asp
    >
    > Thanks


    You might want to have a browse of the www.irt.org site specifically:
    http://www.irt.org/script/form.htm
    (scroll down to the "Changing the Action Property and using several Submit
    Buttons" section)...

    Should give you some actual working code to help you on your way :)

    Cheers
    Gary
    ---------------------------
    NSDesign Internet Solutions
    web: www.nsdesign.co.uk
    support: www.nsdesign.info
    Connection Packages: www.SurfMad.com
    Domain Registration: www.DomainMad.com
     
    NSDesign, Jun 22, 2005
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tom
    Replies:
    3
    Views:
    20,152
    Steve C. Orr [MVP, MCSD]
    Dec 2, 2003
  2. =?Utf-8?B?cmdyYW5kaWRpZXI=?=

    Can I have base class derived from System.Web.UI.Page have design

    =?Utf-8?B?cmdyYW5kaWRpZXI=?=, Jul 22, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    509
    Patrice
    Jul 22, 2005
  3. okaminer
    Replies:
    3
    Views:
    313
    okaminer
    Aug 1, 2005
  4. Danny Anderson
    Replies:
    10
    Views:
    519
    Niklas Borson
    Oct 14, 2003
  5. mark4asp
    Replies:
    2
    Views:
    635
    Jasbird
    Nov 11, 2006
Loading...

Share This Page