Thanks for setting me on the right path.
I did need to fiddle with the examples you provided a bit. Here's what I
ended up with.
To generate the checkboxes with proper values & labels:
foreach (@things) {
$id++;
<f:checkbox name="foo">
<f:value><xsp:expr>$_->get_name</xsp:expr></f:value>
<f:index><xsp:expr>$id</xsp:expr></f:index>
</f:checkbox>;
<xsp:content>
<xsp:expr>$_->get_name</xsp:expr>
</xsp:content>
}
the sub that handles the checkboxes:
sub validate_foo {
my ($ctxt, $value, $id) = @_;
if ($value and $id) {
$ctxt->{Foo}{$value}++;
}
}
and then to do something with them in the submit callback:
foreach (keys %{$ctxt->{Foo}}) {
# do something with $_
}
- Joe
On Fri, 17 Oct 2003 07:59:26 +0100, "Matt Sergeant" <[EMAIL PROTECTED]>
said:
>
> What you should do is assign ids to each:
>
> foreach ... {
> $id++;
> <f:checkbox name="param_name" value="1">
> <f:index><xsp:expr>$id</xsp:expr></f:index>
> </f:checkbox>
> }
>
> Then have a validate sub:
>
> sub validate_param_name {
> my ($ctxt, $value, $id) = @_;
> warn("validate param_name: $value, $id\n");
> if ($value and $id) {
> $ctxt->{Selected_Foo}{$id}++;
> }
> }
>
> Then in your submit function, just access $ctxt->{Selected_Foo}.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]