Skip to content
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

Add support for dynamic widget attributes #80

Merged
merged 1 commit into from
Sep 9, 2013

Conversation

artnez
Copy link
Contributor

@artnez artnez commented Sep 9, 2013

Sometimes it is desirable to set widget attributes after the form is
created. This makes it possible and should be fully backwards
compatible.

@ljharb
Copy link
Collaborator

ljharb commented Sep 9, 2013

Interesting idea!

In order to merge this in, it'll need to be added to every input (including checkbox, select, textarea…), as well as probably label? Also, with thorough tests. Thanks!

Sometimes it is desirable to set widget attributes after the form is
created. This makes it possible and should be fully backwards
compatible.
@artnez
Copy link
Contributor Author

artnez commented Sep 9, 2013

Added the functionality for all remaining fields + tests.

@@ -306,3 +306,13 @@ exports.label = function (test) {
test.done();
};

exports['dynamic widget attributes'] = function(test) {
var re = /autocomplete="no"/;
Copy link
Collaborator

Choose a reason for hiding this comment

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

fyi "no" is an invalid value for this attribute, the only valid options are "on" or "off" - the test is fine tho :-)

ljharb added a commit that referenced this pull request Sep 9, 2013
Add support for dynamic widget attributes
@ljharb ljharb merged commit 5212044 into caolan:master Sep 9, 2013
@ljharb
Copy link
Collaborator

ljharb commented Sep 9, 2013

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants