New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple choices not supported? #142

Closed
olegsv opened this Issue Jun 27, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@olegsv

olegsv commented Jun 27, 2016

Hello,

As far as we can see in 0.10 there is no support for SELECT with multiple="multiple" attribute. The library shows an error on the console.

We have a fix to get rid of the error, but it's far from complete solution:
...

@@ -554,9 +556,15 @@
       inputs = form.querySelectorAll("select[name]");
       for (i = 0; i < inputs.length; ++i) {
         input = inputs.item(i);
-        value = v.sanitizeFormValue(input.options[input.selectedIndex].value, options);
-        values[input.name] = value;
+        for( j=0; j<input.options.length; j++ ) {
+            select_option = input.options[j];
+            if( select_option.selected ) {
+                value = v.sanitizeFormValue( select_option.value, options);
+                values[input.name] = value ;
       }
+        }
+      }

@ansman

This comment has been minimized.

Show comment
Hide comment
@ansman

ansman Jun 28, 2016

Owner

Is this regarding validate.collectFormValues()?

Owner

ansman commented Jun 28, 2016

Is this regarding validate.collectFormValues()?

@olegsv

This comment has been minimized.

Show comment
Hide comment
@olegsv

olegsv Jun 28, 2016

Yes this is.

olegsv commented Jun 28, 2016

Yes this is.

@ansman ansman added this to the Next milestone Jul 3, 2016

@ansman ansman added the enhancement label Jul 3, 2016

@ansman ansman closed this in 7c142c6 Jul 3, 2016

@ansman

This comment has been minimized.

Show comment
Hide comment
@ansman

ansman Nov 5, 2016

Owner

Released in 0.11.0

Owner

ansman commented Nov 5, 2016

Released in 0.11.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment