Set max value of an input box based on another input box

后端 未结 1 700
一个人的身影
一个人的身影 2021-01-29 11:15

How can I set the max value of amount input box based on balance input box? For example, if the value of balance input box is 500 so the max value of amount input box is 500. So

相关标签:
1条回答
  • 2021-01-29 11:34

    First of all, you are injecting the value directly on the input payment_balance, that's not the most cleanest angular way to do it. You should use $scope (check my js example below) so you could change it on the fly without need to find the input over and over again (probably not a problem on this particullary code, but one thing to have in mind).

    Second, you should use a <form> to check for properties like $error or $dirty. That being said, I did an small example (not focusing the retrieved data).

    Happy coding =}

    0 讨论(0)
提交回复
热议问题