Hi, i have this code that works and works more or less:
I have 2 fields:
"Pa_mes" (in this field I have the code)
"Pa_diario"
If you capture in field "pa_mes" 400 in the field "pa_diario" add 410 and it is incorrect should be 110, because the amount is less than 1000.
If you capture in field "pa_mes" 4500 in the field "pa_diario" add 410 and it is correct, because the quantity is greater than 4000.
When I delete the quantity from the "pa_mes" field in the field "pa_diario", the quantity is not eliminated, why? In advance thank you very much.
{ // keys = event types, values = handler functions
"change": function(e) {
if (this.value == "") {
$(this).fields("pa_diario").value(); // Set value
} else if (this.value < "1000") {
$(this).fields("pa_diario").value("100"); // Set value
} else if (this.value < "2000") {
$(this).fields("pa_diario").value("200"); // Set value
} else if (this.value < "3000") {
$(this).fields("pa_diario").value("300"); // Set value
} else if (this.value < "4000") {
$(this).fields("pa_diario").value("400"); // Set value
}
}
}