Jump to content

Updating multiple items with one form


dprichard

Recommended Posts

I am using a do while loop to run through a list of items on my page.  Say I have 5 items on the page and each has one field that the user can input information to.  Is there a way to do an update where it will update all records on the page with one submit form?

Link to comment
https://forums.phpfreaks.com/topic/56356-updating-multiple-items-with-one-form/
Share on other sites

Yes, it is a list of folders and each line has a form field with the ID CategoryOrder.  I want the user to be able to change several CateogryOrder if they want and then submit the form once.  That is the only field they will be updating. 

Okay, I found this article that I think is pointing me in the right direction. 

 

http://lists.nyphp.org/pipermail/front-end/2004-February/000196.html

 

I see that he has the input type listed with [id1], [id2], [id3], etc. 

 

Can someone point me to an article or assist me with how to do the bracketed number that increases for the name of each CategoryOrder form element?

 

Here is my current HTML

 

 <?php do { ?>
                  <tr>
                    <td width="10" class="list_item_boxleft"><table width="1" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td class="icon_box"><input type="hidden" name="CategoryID" id="CategoryID" value="<?php echo $row_categories['CategoryID']; ?>">
                              <input name="submit" type="image" src="/images/cabinet.png" alt="View items in this category" width="16" height="16">
                          </td>
                        </tr>
                    </table></td>
                    <td class="list_item_box_highlightedleft"><?php echo $row_categories['CategoryName']; ?></td>
                    <td class="list_item_box"><?php echo $row_categories['CategoryDescription']; ?></td>
                    <td class="list_item_box"><?php echo $row_categories['CatCreatorName']; ?></td>
                    <td class="list_item_box"><?php echo $row_categories['doc_cat_status_name']; ?></td>
                    <td width="3" class="list_item_box"><label>
                      <input name="CategoryOrder" type="text" id="CategoryOrder" size="3" maxlength="3" value="<?php echo $row_categories['CategoryOrder']; ?>">
                    </label></td>
                    <td class="list_item_boxright"> </td>
                  </tr>
                  <?php } while ($row_categories = mysql_fetch_array($categories)); ?>

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.