0

When numbers are entered in the price(Fiyat) fields in the picture, I want the place that says 0 TL to change. The place that says 0 TL should be the sum of the numbers step by step. How can i do that?

<td><input (keypress)="keyPressNumbersWithDecimal($event)" type="text" id="price_{{i}}" name="price"/></td>

<td colspan="3" style="color: #f87575; text-align: right; ">{{totalPrice}} TL</td>

Note : number of inputs is dynamic

enter image description here

2
  • are the total number of inputs dynamic in number? if they are static you could just use two way binding. Then your 0 TL would be something like <span>{{ prop1 + prop2 + prop3}} TL</span> Commented Aug 28, 2022 at 20:21
  • Number of inputs is dynamic Commented Aug 28, 2022 at 21:00

1 Answer 1

0

Instead of

<input (keypress)="keyPressNumbersWithDecimal($event)" type="text" id="price_{{i}}" name="price"/>

Try

<input [(ngModel)]="totalPrice" type="text" id="price_{{i}}" name="price"/>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.