Ask a Question related to ASP.NET General, Design and Development.

  1. #1

    Default Multiple Forms

    I want to make a page that has 2 forms on it but I can't use any
    runat=server controls because there can only be one runat=server form. Is
    there a way of having 2 forms with runat=server controls or do I have to
    resort to normal forms with submit burrons and processing the request
    manually when Page_Load fires?


    Jonathan Amend Guest

  2. Similar Questions and Discussions

    1. Multiple Forms in one page
      Is there any way to have multiple forms in one page without having the forced space between the submit buttons that each form has? In other...
    2. processing multiple forms
      Hi, I am currently using several forms for submitting data and as each form is submitted then it is delt with and then the next page is called. But...
    3. Multiple forms on one page
      I am trying to put together a stripped-down online order form that allows a user to enter quantities ordered for a bunch of products, as well as...
    4. SSL Forms Login for multiple sites
      Hi, SSL newbie would love some advice :-) I have a server that hosts several independant domains (using host headers to differentiate them)....
    5. How to include multiple <forms> on one ASP.NET page
      Hi, I need to create an ASPX page that includes both traditional HTML Forms (which are submitted to a third-party site like a travel booking...
  3. #2

    Default Re: Multiple Forms

    Hi Jonathan,

    If you really, really, *really* need two server-side forms, then check out
    Paul's[1] site which includes such a control.

    [1] [url]http://www.wilsondotnet.com/[/url]

    --
    Victor Garcia Aprea
    Microsoft MVP | ASP.NET
    Looking for insights on ASP.NET? Read my blog:
    [url]http://obies.com/vga/blog.aspx[/url]
    To contact me remove 'NOSPAM'. Please post all questions to the newsgroup
    and not by private mail.

    "Jonathan Amend" <cephas_is@hotmail.com> wrote in message
    news:3f14b5f5$1_1@aeinews....
    > I want to make a page that has 2 forms on it but I can't use any
    > runat=server controls because there can only be one runat=server form. Is
    > there a way of having 2 forms with runat=server controls or do I have to
    > resort to normal forms with submit burrons and processing the request
    > manually when Page_Load fires?
    >
    >

    Victor Garcia Aprea [MVP] Guest

  4. #3

    Default Re: Multiple Forms

    You cannot have 2 runat=server forms on the same form unless one of them is
    invisible.
    One potential workaround is to use an IFrame.
    Here's more info on IFrames:
    [url]http://msdn.microsoft.com/workshop/author/dhtml/reference/objects/IFRAME.asp[/url]

    --
    I hope this helps,
    Steve C. Orr, MCSD
    [url]http://Steve.Orr.net[/url]

    "Jonathan Amend" <cephas_is@hotmail.com> wrote in message
    news:3f14b5f5$1_1@aeinews....
    > I want to make a page that has 2 forms on it but I can't use any
    > runat=server controls because there can only be one runat=server form. Is
    > there a way of having 2 forms with runat=server controls or do I have to
    > resort to normal forms with submit burrons and processing the request
    > manually when Page_Load fires?
    >
    >

    Steve C. Orr, MCSD Guest

  5. #4

    Default Multiple Forms

    Is it possible to tell a browser to send form a to URL a and form b to
    URL b?

    (i.e. post to two different URLS)

    Thanks,

    -Dan
    Dan Anderson Guest

  6. #5

    Default Re: Multiple forms

    Well, one way would be by the data that was submitted.

    Another way would be to use two separate action pages.

    Another way would be to put a hidden input in both forms with the same name.

    <input type="hidden" name="whichForm" value="1">
    <input type="hidden" name="whichForm" value="2">


    Don't go buy values of submit buttons or anything, since they're be empty if
    the user ENTERs or Ctrl+Ms to submit.

    Ray at work


    "Joel Brabant" <joel.brabant@tembec.com> wrote in message
    news:0fd001c3813a$c0bfd6f0$a001280a@phx.gbl...
    > If my page has 2 forms and I use POST on both that calls
    > the itself, how can I know from my asp code which form was
    > submitted.
    >
    > Thank You.

    Ray at Guest

  7. #6

    Default Multiple forms

    Is it possible to tell the name of a form being submitted?

    I have 2 forms on a page and want to choose an action depending on which one is submitted...
    suntin Guest

  8. #7

    Default Re: Multiple forms

    Put a seperate hidden field in each form tha identifies it. Or name your submit buttons different names!!

    Make sense?
    Stressed_Simon Guest

  9. #8

    Default Re: Multiple forms

    the hidden form field is something i thought of, just wanted a more elegant way of doing it...

    But not following on the button names...
    suntin Guest

  10. #9

    Default Re: Multiple forms

    You have 2 forms right? So that means you have 2 submit buttons? Well submit
    buttons should have a name attribute:-

    <input type="submit" name="FirstForm" value="click here" />

    Well if you give the two submit different names then you can differentiate
    between the forms as depending on which button is clicked you will have a
    variable called FORM.ChosenName.

    Make sense?

    Stressed_Simon Guest

  11. #10

    Default Re: Multiple forms

    You say you have two separate forms. Seems to me like you could add a URL
    variable in the action attribute of the two <form> tags in order to identify
    which form was submitted.

    As for the button names, I think he was referring to one form having
    multiple submit buttons; each with a different assigned value. Example:
    [insert new], [edit], and [delete]. Upon submission of the form, the value
    of the form's submit button used could be evaluated and the perscribed
    action taken.

    ~Bill


    "suntin" <webforumsuser@macromedia.com> wrote in message
    news:d5snru$5c3$1@forums.macromedia.com...
    > the hidden form field is something i thought of, just wanted a more
    > elegant way of doing it...
    >
    > But not following on the button names...

    Bill Goldner Guest

  12. #11

    Default Re: Multiple forms

    .....you might want to use if clause...something such...
    <cfif ISDefined("FORM.ChosenName")
    <cflocation url=sendmethere.cfm>
    <else><cfinclude template=theotherform.cfm>
    </cfif>
    odette007 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139