Submitting multiple record IDs via a form.

Ask a Question related to ASP, Design and Development.

  1. #1

    Default Submitting multiple record IDs via a form.

    I have a problem more to do with style than ability; I can solve this
    problem in a number of ways, but I'm keen to find the best way of doing
    this...

    We have a facility on our intranet where users can log problems, comments &
    suggestions about the site to a DB.
    I'm building a page that lists the outstanding entries, and allows use to
    mark any number of entries as being 'done'

    That is, we have a number of rows, with the last field in each row being a
    checkbox to indicate the entry has been dealt with. At the end, there is an
    Update button which submits the form.

    The question is.. how to handle this...?

    The best solution I have thought of so far is to use the record ID as the ID
    for each checkbox. Then to Split() the resulting Request.Form into an array,
    loop through the array picking out the record IDs.

    It's not a bad solution, but I figured this must be a fairly common
    procedure and that somebody might have a slicker way of doing it...

    Any ideas?

    Chris




    CJM Guest

  2. Similar Questions and Discussions

    1. Multiple emails when submitting a form?
      Does anyone know whether or not you can have a form submit to multiple email address' when you submit a form? Especially when you distribute the...
    2. Submitting data from single tab using multiple tab form
      I have a flash form with multiple tabs. When a submit button is pressed, however, I would like only the information from the current tab to go to...
    3. Record Insertion Form causes multiple entries
      I'm using DMX with PHP / MySQL and the Record Insertion Form from the Application tab. I test the form and check the database only to find that...
    4. Use PDf fill in form in Website and submitting form info.
      I feel like I'm 99% there, but I am missing something. I created the PDF form offline and tested submitting it. It works fine. When I upload and...
    5. How do you delete a record form multiple tables
      I have a dbase that has about 30 tables in it. How can I delete a record out of all of the tables without doing 30 DELETE statements? Example:...
  3. #2

    Default Re: Submitting multiple record IDs via a form.

    Name all the checkboxes the same, and use the ID number for the values, as
    so:


    <input name="chkID" value="1">
    <input name="chkID" value="5">
    <input name="chkID" value="13">
    <input name="chkID" value="19">


    Then on the page that processes, update them all with one SQL statement.

    sToUpdate = Request.Form("chkID")
    ''will return a string like 1, 5, 13, 19


    If Len(sToUpdate) > 0 Then
    sSQL = "UPDATE TheTable SET TheColumn=TheValue WHERE [ID] IN (" &
    sToUpdate & ")"
    ''create connection here
    YourADOConnection.Execute sSQL
    End If

    Ray at work

    "CJM" <cjmwork@yahoo.co.uk> wrote in message
    news:O7d4wDXmDHA.3688@TK2MSFTNGP11.phx.gbl...
    > I have a problem more to do with style than ability; I can solve this
    > problem in a number of ways, but I'm keen to find the best way of doing
    > this...
    >
    > We have a facility on our intranet where users can log problems, comments
    &
    > suggestions about the site to a DB.
    > I'm building a page that lists the outstanding entries, and allows use to
    > mark any number of entries as being 'done'
    >
    > That is, we have a number of rows, with the last field in each row being a
    > checkbox to indicate the entry has been dealt with. At the end, there is
    an
    > Update button which submits the form.
    >
    > The question is.. how to handle this...?
    >
    > The best solution I have thought of so far is to use the record ID as the
    ID
    > for each checkbox. Then to Split() the resulting Request.Form into an
    array,
    > loop through the array picking out the record IDs.
    >
    > It's not a bad solution, but I figured this must be a fairly common
    > procedure and that somebody might have a slicker way of doing it...
    >
    > Any ideas?
    >
    > Chris
    >
    >
    >
    >

    Ray at Guest

  4. #3

    Default Re: Submitting multiple record IDs via a form.

    Don't forget to update the values that were unchecked. That is, if a
    checkbox had been checked, and then it was unchecked, it would not be
    reflected in Ray's solution.



    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:exbxtGXmDHA.2200@TK2MSFTNGP12.phx.gbl...
    > Name all the checkboxes the same, and use the ID number for the values, as
    > so:
    >
    >
    > <input name="chkID" value="1">
    > <input name="chkID" value="5">
    > <input name="chkID" value="13">
    > <input name="chkID" value="19">
    >
    >
    > Then on the page that processes, update them all with one SQL statement.
    >
    > sToUpdate = Request.Form("chkID")
    > ''will return a string like 1, 5, 13, 19
    >
    >
    > If Len(sToUpdate) > 0 Then
    > sSQL = "UPDATE TheTable SET TheColumn=TheValue WHERE [ID] IN (" &
    > sToUpdate & ")"
    > ''create connection here
    > YourADOConnection.Execute sSQL
    > End If
    >
    > Ray at work
    >
    > "CJM" <cjmwork@yahoo.co.uk> wrote in message
    > news:O7d4wDXmDHA.3688@TK2MSFTNGP11.phx.gbl...
    > > I have a problem more to do with style than ability; I can solve this
    > > problem in a number of ways, but I'm keen to find the best way of doing
    > > this...
    > >
    > > We have a facility on our intranet where users can log problems,
    comments
    > &
    > > suggestions about the site to a DB.
    > > I'm building a page that lists the outstanding entries, and allows use
    to
    > > mark any number of entries as being 'done'
    > >
    > > That is, we have a number of rows, with the last field in each row being
    a
    > > checkbox to indicate the entry has been dealt with. At the end, there is
    > an
    > > Update button which submits the form.
    > >
    > > The question is.. how to handle this...?
    > >
    > > The best solution I have thought of so far is to use the record ID as
    the
    > ID
    > > for each checkbox. Then to Split() the resulting Request.Form into an
    > array,
    > > loop through the array picking out the record IDs.
    > >
    > > It's not a bad solution, but I figured this must be a fairly common
    > > procedure and that somebody might have a slicker way of doing it...
    > >
    > > Any ideas?
    > >
    > > Chris
    > >
    > >
    > >
    > >
    >
    >

    Tom B Guest

  5. #4

    Default Re: Submitting multiple record IDs via a form.

    Fair point, but in this instance once an entry has been marked as 'done' is
    disappears... there is no unchecking capability.

    Thanks

    "Tom B" <shuckle@hotmail.com> wrote in message
    news:eAzVoMXmDHA.3312@tk2msftngp13.phx.gbl...
    > Don't forget to update the values that were unchecked. That is, if a
    > checkbox had been checked, and then it was unchecked, it would not be
    > reflected in Ray's solution.
    >
    >
    >
    > "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    > news:exbxtGXmDHA.2200@TK2MSFTNGP12.phx.gbl...
    > > Name all the checkboxes the same, and use the ID number for the values,
    as
    > > so:
    > >
    > >
    > > <input name="chkID" value="1">
    > > <input name="chkID" value="5">
    > > <input name="chkID" value="13">
    > > <input name="chkID" value="19">
    > >
    > >
    > > Then on the page that processes, update them all with one SQL statement.
    > >
    > > sToUpdate = Request.Form("chkID")
    > > ''will return a string like 1, 5, 13, 19
    > >
    > >
    > > If Len(sToUpdate) > 0 Then
    > > sSQL = "UPDATE TheTable SET TheColumn=TheValue WHERE [ID] IN (" &
    > > sToUpdate & ")"
    > > ''create connection here
    > > YourADOConnection.Execute sSQL
    > > End If
    > >
    > > Ray at work
    > >
    > > "CJM" <cjmwork@yahoo.co.uk> wrote in message
    > > news:O7d4wDXmDHA.3688@TK2MSFTNGP11.phx.gbl...
    > > > I have a problem more to do with style than ability; I can solve this
    > > > problem in a number of ways, but I'm keen to find the best way of
    doing
    > > > this...
    > > >
    > > > We have a facility on our intranet where users can log problems,
    > comments
    > > &
    > > > suggestions about the site to a DB.
    > > > I'm building a page that lists the outstanding entries, and allows use
    > to
    > > > mark any number of entries as being 'done'
    > > >
    > > > That is, we have a number of rows, with the last field in each row
    being
    > a
    > > > checkbox to indicate the entry has been dealt with. At the end, there
    is
    > > an
    > > > Update button which submits the form.
    > > >
    > > > The question is.. how to handle this...?
    > > >
    > > > The best solution I have thought of so far is to use the record ID as
    > the
    > > ID
    > > > for each checkbox. Then to Split() the resulting Request.Form into an
    > > array,
    > > > loop through the array picking out the record IDs.
    > > >
    > > > It's not a bad solution, but I figured this must be a fairly common
    > > > procedure and that somebody might have a slicker way of doing it...
    > > >
    > > > Any ideas?
    > > >
    > > > Chris
    > > >
    > > >
    > > >
    > > >
    > >
    > >
    >
    >

    CJM Guest

  6. #5

    Default Re: Submitting multiple record IDs via a form.

    That's exactly what I was looking for.

    Glad I asked now..

    tx

    Chris

    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:exbxtGXmDHA.2200@TK2MSFTNGP12.phx.gbl...
    > Name all the checkboxes the same, and use the ID number for the values, as
    > so:
    >
    >
    > <input name="chkID" value="1">
    > <input name="chkID" value="5">
    > <input name="chkID" value="13">
    > <input name="chkID" value="19">
    >
    >
    > Then on the page that processes, update them all with one SQL statement.
    >
    > sToUpdate = Request.Form("chkID")
    > ''will return a string like 1, 5, 13, 19
    >
    >
    > If Len(sToUpdate) > 0 Then
    > sSQL = "UPDATE TheTable SET TheColumn=TheValue WHERE [ID] IN (" &
    > sToUpdate & ")"
    > ''create connection here
    > YourADOConnection.Execute sSQL
    > End If
    >
    > Ray at work
    >
    > "CJM" <cjmwork@yahoo.co.uk> wrote in message
    > news:O7d4wDXmDHA.3688@TK2MSFTNGP11.phx.gbl...
    > > I have a problem more to do with style than ability; I can solve this
    > > problem in a number of ways, but I'm keen to find the best way of doing
    > > this...
    > >
    > > We have a facility on our intranet where users can log problems,
    comments
    > &
    > > suggestions about the site to a DB.
    > > I'm building a page that lists the outstanding entries, and allows use
    to
    > > mark any number of entries as being 'done'
    > >
    > > That is, we have a number of rows, with the last field in each row being
    a
    > > checkbox to indicate the entry has been dealt with. At the end, there is
    > an
    > > Update button which submits the form.
    > >
    > > The question is.. how to handle this...?
    > >
    > > The best solution I have thought of so far is to use the record ID as
    the
    > ID
    > > for each checkbox. Then to Split() the resulting Request.Form into an
    > array,
    > > loop through the array picking out the record IDs.
    > >
    > > It's not a bad solution, but I figured this must be a fairly common
    > > procedure and that somebody might have a slicker way of doing it...
    > >
    > > Any ideas?
    > >
    > > Chris
    > >
    > >
    > >
    > >
    >
    >

    CJM 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