On 05/07/07, kewei xiao <[EMAIL PROTECTED]> wrote:
In the update of my form, I have a checkbox called 'administrator'. I want this checkbox to be checked when the user is administrator, otherwise the checkbox stays unchecked. So far I have written an customized element which can show the checkbox checked, but it stays checked even the user is not administrator.
checkboxes are a little different from other form fields, in that default() and value() are not simply aliases to each other. value() is always set - it's the value that the browser returns if the checkbox is checked. If the form hasn't been submitted, then the checkbox will only be rendered checked if default() equals value(). If the form has has been submitted, then the checkbox will be rendered checked if the submitted value equals value(). If that doesn't clear it up - you'll need to show up your code, for help. Cheers, Carl _______________________________________________ HTML-FormFu mailing list HTML-FormFu@lists.scsys.co.uk http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu