hueitan / angular-validation

[INACTIVE] Client Side Validation for AngularJS 1. (You should use version > 2 :boom:)
http://hueitan.github.io/angular-validation/
703 stars 176 forks source link

form group/groups #270

Closed burhanfarooqws closed 7 years ago

burhanfarooqws commented 7 years ago

Hi,

can I use more than one form group on one element. my page actually need this kind of feature like nested form child form has limited element with parent form add more element but on parent submit I need to make sure child form is also valid.

any idea if this is possible?

hueitan commented 7 years ago

have you tried validation-group={scope}, update the scope when you click the different button.

burhanfarooqws commented 7 years ago

screenshot_20170115-150746

Here is my screen, the child form has fields but OTP field is not required as for send otp click the value is fetched & put by user .... but on register click i need to validate all fields .... kind of confuse how to achieve it ....

Thanks

hueitan commented 7 years ago

@lvarayut do you have any idea of using validation-group here?

lvarayut commented 7 years ago

I'm not quite sure if I understand the question correctly. Based on the provided example, all fields are marked as "*" indicating mandatory fields. Couldn't we just use a normal validator="required" and bind validation-submit="Form" with the Register button?

burhanfarooqws commented 7 years ago

The use case is when user click send OTP button the OTP field should not be validated as its a server call which generate password send to user on email. then user put it in the OTP field now user can re-send OTP if he wants. When user click register button the OTP must be validated kind of conditonal required but form submit is trouble in this when use ng-required conditional.

What should be my approach.?

lvarayut commented 7 years ago

In this case, I think we might need some kind of condition to make OTP field optional. Could you take a look at #152 and #229?