submitting more than one form

Discussion in 'ASP General' started by Sara, Mar 10, 2005.

  1. Sara

    Sara Guest

    Hi all,
    I don't know if this is possible or if it even makes sense, but this is what
    I want to do. I have a page with a form to fill in a timesheet for a user.
    Depending on how many users did a "job", a form will appear on the page for
    each user. So basically, you could have 3 forms, all with the same names etc.
    and the only thing distinguishing them is a hidden input with userID and
    different data for each user. Now what I want the person to be able to do is
    fill out all the forms on the page and submit them at one time, rather than
    one at a time. Then in the asp, I'd like to iterate through each form that
    was submitted (obv I don't know how many were so I assume I'd go through a
    collection if one exists) and process them one after the next.
    Is this possible and if so, how do I submit them all together and how do I
    then go through them on the asp side.

    Thanks in advance for any help or for a better approach to this prob.

    --
    Sara
    Sara, Mar 10, 2005
    #1
    1. Advertising

  2. Sara

    Roland Hall Guest

    "Sara" wrote in message
    news:...
    : I don't know if this is possible or if it even makes sense, but this is
    what
    : I want to do. I have a page with a form to fill in a timesheet for a user.
    : Depending on how many users did a "job", a form will appear on the page
    for
    : each user. So basically, you could have 3 forms, all with the same names
    etc.
    : and the only thing distinguishing them is a hidden input with userID and
    : different data for each user. Now what I want the person to be able to do
    is
    : fill out all the forms on the page and submit them at one time, rather
    than
    : one at a time. Then in the asp, I'd like to iterate through each form that
    : was submitted (obv I don't know how many were so I assume I'd go through a
    : collection if one exists) and process them one after the next.
    : Is this possible and if so, how do I submit them all together and how do I
    : then go through them on the asp side.
    :
    : Thanks in advance for any help or for a better approach to this prob.

    I don't know if what you're asking is possible. I have written an example
    to show you how to build a form with a dynamic number of elements. You
    would be passing the number of elements somehow to this page, either posting
    from another form or on the URL as a querystring element. I have you select
    the number of users from a range of 1 to 5.

    When you post, it will create the form for user input. You can pass the
    user IDs but here I'm having you enter them, along with a name and an age,
    as an example.

    When you post again, I will display the results. You could use this area to
    also submit to a database.

    This is all done on one page and although a simple example, it can really be
    any size simply by adding more input fields. You could really be creative
    and make the fields dynamic as well.

    http://kiddanger.com/lab/formsarray.asp

    HTH...

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
    Roland Hall, Mar 10, 2005
    #2
    1. Advertising

  3. Sara

    Sara Guest

    Thanks Roland.
    I'm aware that I can do it your way, I was just hoping I could do it the way
    I suggested cause it's simpler!
    But I think I'll take your suggestion because my way doesn't seem possible.

    Sara

    "Roland Hall" wrote:

    > "Sara" wrote in message
    > news:...
    > : I don't know if this is possible or if it even makes sense, but this is
    > what
    > : I want to do. I have a page with a form to fill in a timesheet for a user.
    > : Depending on how many users did a "job", a form will appear on the page
    > for
    > : each user. So basically, you could have 3 forms, all with the same names
    > etc.
    > : and the only thing distinguishing them is a hidden input with userID and
    > : different data for each user. Now what I want the person to be able to do
    > is
    > : fill out all the forms on the page and submit them at one time, rather
    > than
    > : one at a time. Then in the asp, I'd like to iterate through each form that
    > : was submitted (obv I don't know how many were so I assume I'd go through a
    > : collection if one exists) and process them one after the next.
    > : Is this possible and if so, how do I submit them all together and how do I
    > : then go through them on the asp side.
    > :
    > : Thanks in advance for any help or for a better approach to this prob.
    >
    > I don't know if what you're asking is possible. I have written an example
    > to show you how to build a form with a dynamic number of elements. You
    > would be passing the number of elements somehow to this page, either posting
    > from another form or on the URL as a querystring element. I have you select
    > the number of users from a range of 1 to 5.
    >
    > When you post, it will create the form for user input. You can pass the
    > user IDs but here I'm having you enter them, along with a name and an age,
    > as an example.
    >
    > When you post again, I will display the results. You could use this area to
    > also submit to a database.
    >
    > This is all done on one page and although a simple example, it can really be
    > any size simply by adding more input fields. You could really be creative
    > and make the fields dynamic as well.
    >
    > http://kiddanger.com/lab/formsarray.asp
    >
    > HTH...
    >
    > --
    > Roland Hall
    > /* This information is distributed in the hope that it will be useful, but
    > without any warranty; without even the implied warranty of merchantability
    > or fitness for a particular purpose. */
    > Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    > WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    > MSDN Library - http://msdn.microsoft.com/library/default.asp
    >
    >
    >
    Sara, Mar 11, 2005
    #3
  4. Sara

    Roland Hall Guest

    "Sara" wrote in message
    news:D...
    : Thanks Roland.

    You're welcome.

    : I'm aware that I can do it your way, I was just hoping I could do it the
    way
    : I suggested cause it's simpler!
    : But I think I'll take your suggestion because my way doesn't seem
    possible.

    If it is possible, I'm not aware of it.
    Good luck.

    --
    Roland Hall
    /* This information is distributed in the hope that it will be useful, but
    without any warranty; without even the implied warranty of merchantability
    or fitness for a particular purpose. */
    Technet Script Center - http://www.microsoft.com/technet/scriptcenter/
    WSH 5.6 Documentation - http://msdn.microsoft.com/downloads/list/webdev.asp
    MSDN Library - http://msdn.microsoft.com/library/default.asp
    Roland Hall, Mar 11, 2005
    #4
    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. Alan Silver
    Replies:
    4
    Views:
    498
    Alan Silver
    Jul 3, 2005
  2. Merciadri Luca
    Replies:
    4
    Views:
    799
  3. Bob Rashkin
    Replies:
    5
    Views:
    64
    Dennis Lee Bieber
    Dec 23, 2013
  4. Steven D'Aprano
    Replies:
    0
    Views:
    75
    Steven D'Aprano
    Dec 23, 2013
  5. Replies:
    3
    Views:
    69
    Gary Herron
    Dec 23, 2013
Loading...

Share This Page