modified checkbox rendering: use createCheckBoxParam() instead of createInputParam(), checkboxes now preserve their status even if the user is redirected back to the form

This commit is contained in:
Robert Gaggl 2004-01-02 10:45:25 +00:00
parent 3ee00ed75d
commit 6b4c7649a2
3 changed files with 21 additions and 24 deletions

View file

@ -49,9 +49,9 @@ function email_macro(param) {
function publishemail_macro(param) {
if (param.as == "editor") {
var inputParam = this.createInputParam("publishemail", param);
if ((req.data.save && req.data.publishemail) || (!req.data.save && this.publishemail))
inputParam.checked = "checked";
var inputParam = this.createCheckBoxParam("publishemail", param);
if (req.data.save && !req.data.publishemail)
delete inputParam.checked;
Html.checkBox(inputParam);
} else
res.write(this.publishemail ? "yes" : "no");