Microsoft provides programming examples for illustration only, without warranty either
expressed or implied, including, but not limited to, the implied warranties of
merchantability and/or fitness for a particular purpose. This article assumes
that you are familiar with the programming language being demonstrated and the
tools used to create and debug procedures. Microsoft support professionals can
help explain the functionality of a particular procedure, but they will not
modify these examples to provide added functionality or construct procedures to
meet your specific needs. If you have limited programming experience, you may
want to contact a Microsoft Certified Partner or the Microsoft fee-based
consulting line at (800) 936-5200. For more information about Microsoft Certified
Partners, please visit the following Microsoft Web site:
For more information about the support options that are available and about how to contact Microsoft, visit the following Microsoft Web site:
The following file is available for download from the Microsoft Download Center:
Release Date: May 15, 2001
For additional information about how to download Microsoft Support files, click the following article number to view the article in the Microsoft Knowledge Base:
119591 How to Obtain Microsoft Support Files from Online Services
Microsoft scanned this file for viruses. Microsoft used the most current virus-detection software that was available on the date that the file was posted. The file is stored on security-enhanced servers that help to prevent any unauthorized changes to the file.
Select_Example.exe contains the following files:
File Name | Size |
---|
Select_Many.htm | 6 kb |
Parse_All.asp | 1 kb |
Select_Many.htm
1. | Download Select_Example.exe, and open Select_Many.htm. |
2. | Provide the number of rows that you want to add, and click Add rows to add table rows on the Web page. |
3. | Click any row to display the drop-down list box, and change the selection. If you click Hide Dropdowns, the drop-down list boxes disappear from the page. |
Parse_All.asp
The sample code in Parse_All.asp demonstrates that all of the values that are associated with the form (even the added dynamic rows and the values that the user changes) are propagated to the server.
How the Sample Works
A single row, which contains <SELECT> tags, is dynamically placed on top of the table row that the user clicks. When a user clicks within a table row, the
handle_click function is called, and the
parentElement property determines the position of the table row that contains the cell that the user clicks. Before hiding the current row, the contents of <SELECT> tags are transferred into the previously selected row (which are stored in
holder_row). The current contents of each table column in the newly selected row are then used to determine which element is selected within the corresponding <SELECT> tag. The table row is hidden when the <SELECT> tag is positioned on the new row.
This sample demonstrates that it is possible to implement a DHTML page to utilize multiple <SELECT> tags without using a separate <SELECT> tag for each cell within a table. This sample code is one among many ways to accomplish this task.