I work with form using Smarty. There are some validation to check the phone number and email using regular expression. And if it's all correct, users can jump into the confirmation page, otherwise these checks shuold be remained. I use checkboxes_html with some option "selected". But all checks I made are gone if the validation doesn't succeed.
[php]
// Lists for the radio button
$smarty->assign('genre_output', array('apple','chiken','tuna'));
$smarty->assign('genre_values', array('apple','chiken','tuna'));
[html]
<tr>
<th>Genre</th>
<td>
{html_checkboxes name="genre" values=$genre_values output=$genre_output selected="{$data['genre']|escape}" separator='<br />'}
</td>
</tr>