Ticket #1386 (closed defect: fixed)
Setting default checkbox settings in dialogs does not work in Safari
|Reported by:||nicholasbs||Owned by:||nicholasbs|
Setting the default value for checkboxes in dialogs does not currently work in Safari. This is because if no value attribute is specified on the input element, Safari returns the default value as an empty string, whereas Firefox, IE, and Opera all return the string "on" as the default value. I don't know which of these is right, but the code is presently written to expect a default value of "on" (at least in the couple of plugins I've looked at, e.g., TableOperations and SmartReplace?).
We should probably always specify a value for our checkboxes, if only because it's a required attribute in the W3C spec.
However, setting the value of checkboxes to "on" seems a little wonky to me. The Xinha.Dialog.prototype.setValues method works by comparing the value for the given element in the dictionary passed in to the value attribute of the element itself. This too seems a bit weird to me -- wouldn't it make more sense to check against a predetermined string, e.g., 'checked' instead? Is there a good reason why it's done the way it is?