To those in the know, I have a couple of questions about the best way to create dynamic form elements.
I have a script that queries a database and dynamically generates a table, as shown below in the code. What I am attempting to do is have a form element off to the right of each Table Row that the user can select. The problem is I don't know for sure what the variables will be retrieved from the database, but need to have it off to the right, and created on the fly. The user will then select the "Submit" or "Radio button" for the element, and this will create a query to the database, returning several elements. Within these elements created, I then need to have another way of selecting another "Submit" button within each of the values that are returned the first time. My questions are: 1. What is the best type of form element that will send the request to the database? For example, submit, radio, etc.?? 2. How can I have perl create a form element off to the right of each table row that is separate from the table? 3. Am I using the HTML to create the table correctly given what I am trying to do? Any help would be very appreciated. I'm basically just confused on how to implement this with CGI.pm. TIA, -Jason my $sth; $sth = $dbh->prepare ("SELECT rgname, rgnumber, portcnt FROM resourcegroups"); $sth->execute (); my @rgname_edps; my @rgnumber_edps; my @portcnt_edps; my $rg_count = 0; while (my @val = $sth->fetchrow_array()) { $rgname_edps[$rg_count] = $val[0]; $rgnumber_edps[$rg_count] = $val[1]; $portcnt_edps[$rg_count] = $val[2]; $rg_count++; } print qq `<TABLE BORDER="2" WIDTH = "250" ALIGN = "LEFT"> <TR> <TH BGCOLOR="#cccccc" WIDTH = "120">Resource Group</TH> <TH BGCOLOR="#cccccc">Number</TH> <TH BGCOLOR="#cccccc">Total Ports</TH> </TR>`; for ( my $a = 0; $a < $rg_count; $a++ ) { print qq `<TR ALIGN = "LEFT"> <TD ALIGN = "LEFT">$rgname_edps[$a]</TD> <TD ALIGN = "CENTER">$rgnumber_edps[$a]</TD> <TD ALIGN = "CENTER">$portcnt_edps[$a]</TD> </TR> #### Trying to create a form element here #### The user can select among the different #### Rows, and this will prompt a database #### query, creating more displayed data `; } print qq`</TABLE>`; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]