-
Notifications
You must be signed in to change notification settings - Fork 432
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
Option includeDisabled #119
base: master
Are you sure you want to change the base?
Conversation
Thank you. Could you elaborate why this option would be useful? We would also need tests to cover the new use-case. I can review the docs and code comments after that. |
This option is usefull in follow case. |
generates an empty entry for an empty select multiple element
@@ -50,6 +51,10 @@ | |||
if (type === "skip") { | |||
return; // ignore fields with type skip | |||
} | |||
if(obj.multiple) { | |||
type = 'array'; | |||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this check? Maybe we should explain in a comment for clarity
// Filter with the standard W3C rules for successful controls: http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2 | ||
return this.name && // must contain a name attribute | ||
!$el.is(":disabled") && // must not be disable (use .is(":disabled") so that fieldset[disabled] works) | ||
(!$el.is(":disabled") || $el.is(":disabled") && opts.includeDisabled) && // must not be disable (use .is(":disabled") so that fieldset[disabled] works) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
check seems equivalent to (!$el.is(":disabled") || opts.includeDisabled)
} ); | ||
if(!val.length) { | ||
return { name: el.name, el: el } | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when would the array not have a length property? Should that not be factored into the isArray(val)
function check?
If "true" also disabled :input items are included.