You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For <select> HTML elements, LiveValidation only returns the first option selected even if the attribute multiple is set (<select multiple></select>). See in livevalidation,js, line 385:
caseLiveValidation.SELECT:
if(this.element.selectedIndex>=0)return$(this.element).val();// jQuery returns an array when multiple is setelsereturnthis.element.getAttribute("multiple") ? [] : "";
Also, same problem with the submit.
In zotonic-wired.js, line 1854, the check is weird for me:
varone=(t=='select-one');
I think it needs to check for falsy value for the el.getAttribute("multiple").
Offtopic but related
Validation and Submit do not always produce/check the same value (checkbox input is an example);
Checkbox values are strange to me, it returns array or undefined. I think it should be an array only if more elements with the same name exist in the form and should return an empty array, not undefined.
I can do a PR to continue this discussion with some code, but I first want to hear what you think about this @mworrell.
The text was updated successfully, but these errors were encountered:
For
<select>
HTML elements, LiveValidation only returns the first option selected even if the attribute multiple is set (<select multiple></select>
). See inlivevalidation,js
, line 385:I think it needs to be:
Also, same problem with the submit.
In
zotonic-wired.js
, line 1854, the check is weird for me:I think it needs to check for falsy value for the
el.getAttribute("multiple")
.Offtopic but related
I can do a PR to continue this discussion with some code, but I first want to hear what you think about this @mworrell.
The text was updated successfully, but these errors were encountered: