[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl-AnyPerl] Checkbox CGI



I'm trying to "read" a series of checkboxes (one per row) and perform an
operation on each row depending on the state of the checkbox. Something
along the line of:

display_items {
	for ($index = 1; $index<10; $index++) {
	    	print qq{<tr><td><input type="checkbox"  name="xt$index" value="yes"></td>\n};
		print qq{				
			<td width="125">$my_ID</td>
			<td>$my_desc</td>
			</tr>
		};
	}

[remaining code snipped]
	};
}

process_items {
	for ($index = 1; $index<10; $index++) {
	    $is_checked = $test_data{'xt$index'};
	    print "<tr>\n";
	    print "<td>xt$index == $is_checked</td>\n";
	    if ($is_checked eq "yes") {
	    	print qq{<td><input type="checkbox"  name="xt$index" checked ></td>\n};
	    } else {
   	    	print qq{<td><input type="checkbox"  name="xt$index" ></td>\n};
	    }
	}
}

what happens is that I can check the checkboxes, and on calling the cgi,
it results in parameter like: "?xt2=yes" but on process_item the box is
not checked. the print statement in process_item displays "xt2 == " so
for some reason, the param is being lost.

any assist?? or am I going about this all wrong??

Terry

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-anyperl-request@macperl.org