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

@ -245,9 +245,9 @@ function description_macro(param) {
*/
function shareable_macro(param) {
if (param.as == "editor" && !this.site) {
var inputParam = this.createInputParam("shareable", param);
if ((req.data.save && req.data.shareable) || (!req.data.save && this.shareable))
inputParam.checked = "checked";
var inputParam = this.createCheckBoxParam("shareable", param);
if (req.data.save && !req.data.shareable)
delete inputParam.checked;
Html.checkBox(inputParam);
} else if (this.shareable)
res.write(param.yes ? param.yes : "yes");