Skip to content
This repository was archived by the owner on Jul 1, 2020. It is now read-only.
This repository was archived by the owner on Jul 1, 2020. It is now read-only.

Immediate form validation with dependant input elements #102

@tpeter1985

Description

@tpeter1985

Hey it's me again.

I use your library and I think it's very cool.
I currently have a problem which I can't handle.

I have a list for entering absences.
When all data for one entry is given I can check if the user entered too many entries for the given Date.

My problem is that I can only validate this immediately and show a message by adding the same validation-check to every input element.
But the result is showing the same message below every input element.

I created a simplified example on Plunker: http://plnkr.co/edit/FG9uyr1l3cEY7QSehQkr?p=preview

  1. Go to first line, for day enter "1" and select "1 Day Holiday".
  2. Go to second line, for day enter "1" and select "1 Day Holiday".

By clicking submit I see the message under every input element.

Do you have any idea how to handle this?

In my mind it could be handled by executing the validation of an element via the service.
You would only have to put the validation to the day input element and when absence type changes you can refresh the day validation via a service call.
I created a simple Plunker example to show how my idea looks like:
http://plnkr.co/edit/o1fftbnmRfjScEDmi7ZH?p=preview

FYI: In my real application the table has more columns and I use remote validation too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions