Discussion:
Behavior of form validation with required fields
Sebastian Sebald
2013-03-18 10:08:42 UTC
Permalink
Hi everyone,

I stumbled over (IMHO) weird behavior with the validation of fields. I have
a directive that parses/validates decimal numbers that works fine. The user
input can be an decimal (with comma or dot as seperator) or blank. But if
the field is also "required" the decimal directive will be also invalid.
This is because an model field that is required will be set to undefined
not null. Here is a fiddle to illustrate it:
http://jsfiddle.net/distractedBySquirrels/Hb2qV/

Is this behavior on purpose?
--
You received this message because you are subscribed to the Google Groups "AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to angular+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
Visit this group at http://groups.google.com/group/angular?hl=en-US.
For more options, visit https://groups.google.com/groups/opt_out.
Sebastian Sebald
2013-03-18 10:20:06 UTC
Permalink
Here is an small update which handles the
behavior: http://jsfiddle.net/distractedBySquirrels/Hb2qV/3/

Continue reading on narkive:
Loading...