Checkbox syntax

From: Date: Mon, 05 May 2003 19:15:32 +0000
Subject: Checkbox syntax
Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-1356@lists.php.net to get a copy of this message
Let's suposse I have checkboxes inside a section loop so the "name" of each checkbox is: <input type="checkbox" name="{elements[$foo[ix]]}" /> I want to preserve checked boxes when processing a form in the script .. Tried something like.. <input type="checkbox" name="{elements[$foo[ix]]}" {if $smarty.request.elements[$foo[ix]]}checked="checked"{/if} /> but it doesn't work. Which is the best way to do this? Maybe I'm overlooking something more elegant.. Luis

« previous php.smarty.dev (#1356) next »