Skip to content
This repository has been archived by the owner on Aug 16, 2021. It is now read-only.

Traditional module multiple select name fix #35

Merged
merged 8 commits into from
Apr 30, 2015

Conversation

msx2
Copy link
Contributor

@msx2 msx2 commented Apr 17, 2015

@arendjr I noticed I made a small mistake yesterday, so I'm correcting it now :) <select multiple> should have name ending with [] in order to work properly with traditional forms.

@@ -278,6 +278,9 @@ Selectivity.Templates = {
* mode - Mode in which select exists, single or multiple.
*/
selectCompliance: function(options) {
if (options.mode === 'multiple' && !options.name.match(/\[\]$/)) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use options.name.slice(-1) !== '[]'? That seems a bit easier for readability (and performance) than trying to parse a regular expression :)

Also, you can shorten the next line to options.name += '[]'.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, you are right. Syntax updated, synced with current master version and built. :)

@arendjr
Copy link
Owner

arendjr commented Apr 30, 2015

Oops, looks like I misled you with my comment... .slice(-1) should be .slice(-2) of course. Sorry! :)

arendjr added a commit that referenced this pull request Apr 30, 2015
Traditional module multiple select name fix
@arendjr arendjr merged commit 9c0905e into arendjr:master Apr 30, 2015
@arendjr
Copy link
Owner

arendjr commented Apr 30, 2015

Great, thanks!

@msx2 msx2 deleted the traditional-multiple-bugfix branch April 30, 2015 07:35
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants