I Pull info from a database (SQL). And I use this to create cells for each row of data.
while (@row = $sth->fetchrow()){ ## Make our HTML look better if no data. $oid = "&nbsp;" if($oid eq ""); $date = "&nbsp;" if($date eq ""); $username = "&nbsp;" if($username eq ""); print <<HTML; <TR BGCOLOR="#FFFFFF"> <TD><FONT SIZE=2 FACE=ARIAL>$row[0]</FONT></TD> <TD><FONT SIZE=2 FACE=ARIAL>$row[1]</FONT></TD> <TD><FONT SIZE=2 FACE=ARIAL><B>$row[2]</B></FONT></TD> <TD><FONT SIZE=1 FACE=ARIAL> [<A HREF="out_form.cgi?$row[0]">Clock Out</A>] </FONT></TD> </TR> HTML } # End of while.

What i want to do is replace this with a Form. Input that row into a dropdown <select><option> where each <option> is the row of data. Any clues? More details needed? Sounds easy but I tried replacing the code with:
<FORM action=""><select size=10> HTML while (@row = $sth->fetchrow()){ ## Make our HTML look better if no data. $oid = "&nbsp;" if($oid eq ""); $date = "&nbsp;" if($date eq ""); $username = "&nbsp;" if($username eq ""); print <<HTML; <OPTION>$row[0] $row[1] $row[2]</option> HTML } # End of while.

That didn't seem to work. My only conclusion is that i don't use (@row = $sth->fetchrow()

In reply to Trying to add objects in dropdown by nlafferty

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.