4
I have a php variable that has a value that varies depending on the moment!! Example
1st moment $valor = 300
second moment $valor = 20
3rd moment $valor = 5300
fourth moment $valor = 1300
I also have an input, in this input can add any value, as long as it is below the value at the time you type. Here’s what I want to do!! If someone comes to enter a higher value in the input the value automatically changes pro maximo and not to what was typed!!
Example:
1st moment $valor = 300
|| In this first moment the maximum value of the input may be only 300!! Only instead of 300 the user typed 301, at the same time I want these 301 turn 300, because it is the limit value that the user has!
I don’t quite understand the role of PHP. How do you keep the state between the different "moments"? With session variable? Javascript/jQuery only runs after PHP is finished.
– bfavaretto
php put more to signal what use it!
– ivan veloso