Looping through table data on form.submit

Discussion in 'ASP General' started by g, May 29, 2007.

  1. g

    g Guest

    Hi Guys..

    i know this might sound really really simple, but I'm kinda stuck..I
    have this form..which has a table (created from stored procedure
    values)..once the table is populated..i have some radio buttons (for
    each row of the table) and a main submit button.

    On clicking submit..i want to loop through the table..pick up the
    first <TD> being the user ID and the value of the radio button clicked
    (currently I have my radio button ID set as UserID_0, UserID_1 ..
    etc). And pass those into a stored procedure..

    Any help would be great...thanks!

    Cheers,
    Gravity.
    g, May 29, 2007
    #1
    1. Advertising

  2. g

    Evertjan. Guest

    g wrote on 29 mei 2007 in microsoft.public.inetserver.asp.general:
    > i know this might sound really really simple, but I'm kinda stuck..I
    > have this form..which has a table (created from stored procedure
    > values)..once the table is populated..i have some radio buttons (for
    > each row of the table) and a main submit button.


    Do you mean a html table in a form?

    If so. what is serverside [ASP] about it?

    >
    > On clicking submit..i want to loop through the table..pick up the
    > first <TD> being the user ID and the value of the radio button clicked
    > (currently I have my radio button ID set as UserID_0, UserID_1 ..
    > etc). And pass those into a stored procedure..


    Yes Your Q seems a browser thing,
    ASP knowing nothing about html forms, tables and radio butttons.

    How to use the DOM programmatically is more something
    for a clientside javascript NG, like comp.language.javascript.

    Or do you want to know what to do on the srver with the submitted data?

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., May 29, 2007
    #2
    1. Advertising

  3. g

    g Guest

    Well lets put it this way, I have an ASP page..it loads up..reads data
    from a database/ executed stored procedure..runs its loops on it..and
    created an HTML table full of data. This HTML table also has a bunch
    of radio buttons at the end.

    The user selects 1 radio button on each row..and clicks a button
    called Submit. On the button Submit..I call form.submit on it (unless
    there's something better)...the action of the form (that holds the
    table) is post and it appends &Update=1 in the URL..and reloads the
    form.

    On this reload..i check if I'm getting Update=1, if I am..then I want
    to read all the values of the TD's and put them in a database
    (including what they chose in the radio button).

    Does this make sense? I believe this is something that I need to
    trigger on client side and complete on server side.

    Thanks a bunch for your help.


    On May 29, 5:12 pm, "Evertjan." <> wrote:
    > g wrote on 29 mei 2007 in microsoft.public.inetserver.asp.general:
    >
    > > i know this might sound really really simple, but I'm kinda stuck..I
    > > have this form..which has a table (created from stored procedure
    > > values)..once the table is populated..i have some radio buttons (for
    > > each row of the table) and a main submit button.

    >
    > Do you mean a html table in a form?
    >
    > If so. what is serverside [ASP] about it?
    >
    >
    >
    > > On clicking submit..i want to loop through the table..pick up the
    > > first <TD> being the user ID and the value of the radio button clicked
    > > (currently I have my radio button ID set as UserID_0, UserID_1 ..
    > > etc). And pass those into a stored procedure..

    >
    > Yes Your Q seems a browser thing,
    > ASP knowing nothing about html forms, tables and radio butttons.
    >
    > How to use the DOM programmatically is more something
    > for a clientside javascript NG, like comp.language.javascript.
    >
    > Or do you want to know what to do on the srver with the submitted data?
    >
    > --
    > Evertjan.
    > The Netherlands.
    > (Please change the x'es to dots in my emailaddress)
    g, May 29, 2007
    #3
  4. g

    Evertjan. Guest

    Gravity wrote on 29 mei 2007 in microsoft.public.inetserver.asp.general:

    [Please do not toppost on usenet !!!!!!!!!!]

    I wrote:
    >> Do you mean a html table in a form?
    >> If so. what is serverside [ASP] about it?
    >> Or do you want to know what to do on the srver with the submitted
    >> data?


    > Does this make sense? I believe this is something that I need to
    > trigger on client side and complete on server side.


    No it does not really.

    > Well lets put it this way, I have an ASP page..it loads up..reads data
    > from a database/ executed stored procedure..runs its loops on it..and
    > created an HTML table full of data. This HTML table also has a bunch
    > of radio buttons at the end.


    I hope you sensibly named all the to-be-posted fields,
    be it input/text or input/radio. Whether they are put in a html table or
    just divided by <ol><li> or <br> constructs is not important to the
    submission capacities of a form.

    ASP loops can easily do that.

    Do you have a Q about this part?
    [Please add a strippped version of your ASP code if so]

    > The user selects 1 radio button on each row..and clicks a button
    > called Submit. On the button Submit..I call form.submit on it (unless
    > there's something better)...the action of the form (that holds the
    > table) is post and it appends &Update=1 in the URL..


    This seemed to be the clientside code you asked about and for which this
    NG is not the right place.

    > and reloads the form.


    Reloads the "page"?
    [A form is a clientside html element]

    > On this reload..i check if I'm getting Update=1, if I am..then I want
    > to read all the values of the TD's and put them in a database
    > (including what they chose in the radio button).


    You do not need the Update=1, as ASP can easily see if the page request
    includes POST/request.form() [or even GET/request.querystring()] data.

    Simple serverside ASP work, you have a Q about this?
    [Please add a strippped version of your ASP code if so]

    --
    Evertjan.
    The Netherlands.
    (Please change the x'es to dots in my emailaddress)
    Evertjan., May 29, 2007
    #4
  5. g

    g Guest

    On May 29, 6:01 pm, "Evertjan." <> wrote:
    > Gravity wrote on 29 mei 2007 in microsoft.public.inetserver.asp.general:
    >
    > [Please do not toppost on usenet !!!!!!!!!!]
    >
    > I wrote:
    > >> Do you mean a html table in a form?
    > >> If so. what is serverside [ASP] about it?
    > >> Or do you want to know what to do on the srver with the submitted
    > >> data?

    > > Does this make sense? I believe this is something that I need to
    > > trigger on client side and complete on server side.

    >
    > No it does not really.
    >
    > > Well lets put it this way, I have an ASP page..it loads up..reads data
    > > from a database/ executed stored procedure..runs its loops on it..and
    > > created an HTML table full of data. This HTML table also has a bunch
    > > of radio buttons at the end.

    >
    > I hope you sensibly named all the to-be-posted fields,
    > be it input/text or input/radio. Whether they are put in a html table or
    > just divided by <ol><li> or <br> constructs is not important to the
    > submission capacities of a form.
    >
    > ASP loops can easily do that.
    >
    > Do you have a Q about this part?
    > [Please add a strippped version of your ASP code if so]
    >
    > > The user selects 1 radio button on each row..and clicks a button
    > > called Submit. On the button Submit..I call form.submit on it (unless
    > > there's something better)...the action of the form (that holds the
    > > table) is post and it appends &Update=1 in the URL..

    >
    > This seemed to be the clientside code you asked about and for which this
    > NG is not the right place.
    >
    > > and reloads the form.

    >
    > Reloads the "page"?
    > [A form is a clientside html element]
    >
    > > On this reload..i check if I'm getting Update=1, if I am..then I want
    > > to read all the values of the TD's and put them in a database
    > > (including what they chose in the radio button).

    >
    > You do not need the Update=1, as ASP can easily see if the page request
    > includes POST/request.form() [or even GET/request.querystring()] data.
    >
    > Simple serverside ASP work, you have a Q about this?
    > [Please add a strippped version of your ASP code if so]
    >
    > --
    > Evertjan.
    > The Netherlands.
    > (Please change the x'es to dots in my emailaddress)


    No..I think I'm okay..I'll try it out and see if I can get it to
    work!

    Thanks!
    g, May 29, 2007
    #5
    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. Replies:
    2
    Views:
    6,158
  2. Replies:
    2
    Views:
    336
  3. Replies:
    3
    Views:
    647
  4. Aaron
    Replies:
    2
    Views:
    507
    dhtml
    Apr 10, 2011
  5. Replies:
    5
    Views:
    261
Loading...

Share This Page