I have an Angular 2 project with two input fields, greater than and less than. I want to check to ensure that the user input valid values that don't contradict each other for the filter, and I want to do that dynamically on the front end without the user having to submit the form.
To be specific, I want to ensure that the "Greater Than" input is not greater than the value inside the "Less Than" field.
How can I do so?
<form (submit)="onSubmit()" id="inputForm" class="form-group" class="row">
<h3>Price Filters</h3>
<span>Greater than:</span>
<input type="number" name="greaterThanValue" [(ngModel)]="greaterThanValue" placeholder="0">
<span>Less than:</span>
<input type="number" name="lessThanValue" [(ngModel)]="lessThanValue">
<input type="submit">
</form>