-
-
Notifications
You must be signed in to change notification settings - Fork 56
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
Enable number fields #167
Comments
actually, what about a property called "inputAttributes", that would pass on any attributes to the input field.
and in the input template have the following:
of course having a scoped variable would help avoid the ugly $eval expression |
Interesting request. One of formFor's main initial inspirations was the idea of separating the validation rules (min/max, etc) from the view rules. That being said there are clearly some cases where I'm not doing this (input type for example). Hm. Would you be willing to create a pull request for this? I don't have much extra time lately for feature requests but I would be happy to accept a PR. |
I see your point! So tampering with the input field should more or less be through setting validation rules. My suggestion above would mean having validation rules in two separate places - which may of course be confusing. |
Exactly. Inputs can already be validated as numeric (validation That being said, I don't think your idea is bad or anything either. It's just a little bit against the spirit of the library currently. |
Hey @hutzelknecht. Now that I'm back from traveling and have given this some thought, I feel a solution that's more in the spirit of this library would have to involve the validation rules themselves (else we risk the 2 being out of sync). So what I've done is this: for numeric inputs, if the validation rules contain a minimum or maximum value, this will automatically get passed along to the inner
|
FYI this feature is available in the new 4.1.7 release. |
Hi Brian,
i would like to use text fields with type="number", but i would also need to set step="any" and maybe other attribute such as min-value to the input field in order to prevent browser validation for decimals.
Something like this:
Of course this would be possible by introducing a numberField directive, but it would also be possible by adding a config object with numberField specific attributes and adding them to the textField template:
The text was updated successfully, but these errors were encountered: