I am designing a form and am struggling with implementing a if then javascript statement and am curious if there is anything this community can help me with. Here is the scenario.
I have a drop down list called park1.
I have a numerical field called possible1.
I would like to set the dropdown, and based on what the option in the drop down is, have the possible field auto populate with a value.
Here is my javascript code, which I can find no errors in.
if(park1.value == 1) {
possible1.value = '40';
} else if(park1.value == 2) {
possible1.value = 40;
} else if(park1.value == 3){
possible1.value = 35;
} else if(park1.value == 4) {
possible1.value = 40;
} else if(park1.value == 5) {
possible1.value = 30;
} else if(park1.value == 6) {
possible1.value = 30;
} else if(park1.value == 7) {
possible1.value = 35;
} else if(park1.value == 8) {
possible1.value = 40;
} else if(park1.value == 9) {
possible1.value = 40;
} else if(park1.value == 10) {
possible1.value = 35;
} else if(park1.value == 11) {
possible1.value = 40;
} else if(park1.value == 12) {
possible1.value = 40;
} else if(park1.value == 13) {
possible1.value = 30;
} else if(park1.value == 14) {
possible1.value = 35;
} else if(park1.value == 15) {
possible1.value = 40;
} else if(park1.value == 16) {
possible1.value = 40;
} else if(park1.value == 17) {
possible1.value = 35;
} else if(park1.value == 17) {
possible1.value = 35;
} else if(park1.value == 18) {
possible1.value = 30;
} else if(park1.value == 19) {
possible1.value = 35;
} else if(park1.value == 20) {
possible1.value = 30;
} else if(park1.value == 21) {
possible1.value = 40;
} else if(park1.value == 22) {
possible1.value = 35;
} else if(park1.value == 23) {
possible1.value = 35;
} else if(park1.value == 24) {
possible1.value = 40;
} else if(park1.value == 25) {
possible1.value = 40;
} else if(park1.value == 26) {
possible1.value = 35;
} else {
possible1.value = 0;
}
So if the first option, or the drop down option with a value of 1 is set in park1, it should populate possible1 with 40. and so on.
All I get when I implement this on the possible1 field, is a blank white box for possible1. It never changes and is not fillable.
Any help is appreciated. I feel like i am missing something very simple here.
Thanks,