How do I populate numeric value ranges in different fields on a two-page form?
I have a form that contains 6 different fields. I would like them to show values within ranges of a given answer. The field ranges are 5-8, 9-13, 14-17, 18-21, 22-25, and 26-30.
If the value falls between any given range, I would like for my form to populate the number in that range. The other fields should remain blank with no data showing unless the value moves to one of the other ranges. If it does, then the original field should blank out.
Example: for the field of 5-8: if I have a value of 6, then 6 should populate in the 5-8 text box. If the value changes to 12, the 5-8 text box should return to blank, and the 9-13 text box should show the value of 12.
As the values change, the other field range text boxes should react accordingly.
Here's my main problem- I can get the values to populate with the data using if and else if, but for some reason the blocks don't return to blank. They basically show residue numbers in the fields that the user would have to go and manually clear out. My scripting looks like this:
For the 5-8 field:
var v1 = this.getField("C/C Total Score").value;
if (v1 <= 0) {
event.value = " ";}
else if (v1 >=5 && v1 <=8) {
event.value = (v1); }
else if (v1 >8) { event.value = " ";}
For the 9-13 field:
var v1 = this.get.Field("C/C Total Score").value;
if (v1 >= 9 && v1 <= 13) {
event.value = (v1);}
else if (v1 >=13 &&v1 <=9) {event.value = " "; }
else if (v1 >13) {event.value = " "; }
The other range fields look similar except for number changes in the script.
Is there anyone that can help me achieve what I need to do?
