I need to set the maximum value of an input number to the quantity left in the database. Is it possible or is there some ways to do this? I need to validate first if the input value is equal or less than to the stocks left and if greater than it will prompt the message that the input must be less than or equal to the maximum value.
the database sample:
id_item | item | brands | max
- - - - - - - - - - - - - - - - - - - - - - -
1 | Shampoo |creamsilk |2
2 | conditioner |creamsilk |5
3 | soap |safeguard |7