Perl Programming Help:
Feb 26, 2001, 4:26 AM
Okay, so this is really more of a html problem, but I encountered it working with perl, and the form is actually in a cgi program...
This is what I am trying to do:
1. A foreach loop lists several lines (could be any number of lines) with lots of info - part #, quantity, price etc. At the end of each line, there is a checkbox.
2. Price and quantity are in text fields, and the user can change the value. The user checks one or more checkboxes, and the information on the lines with checked boxes gets sent to a cgi processing the input.
PROBLEM: The values of ALL text fields get sent! I ONLY want to send them if the checkbox at the end of the line is checked... how do I make the checkbox apply to the text fields also?
example of outputted code (stripped down to essentials..):
<form action=mycgi.cgi method=post>
<input type=text size=5 name=$qty value=quantity> # name variable values are incremented for every line with the foreach loop
<input type=text size=5 name=$tpr value=target>
<input type=checkbox name=$ok value=result> # part nr and other stuff is stored in $ok
<input type=text size=5 name=$qty value=quantity>
<input type=text size=5 name=$tpr value=price>
<input type=checkbox name=$ok value=result>
Mar 2, 2001, 2:47 PM
you should check the values of each text variable in your CGI. then take appropriate action if the fields are blank.