Hi, I have a puzzling problem. I have one array and three forms on one page. The first form displays data 0-52, second 53-189, third 190-end as a select list. When an option in the first form is clicked, it displays the right variables in a text box. However when the options in the second form (53-189) are clicked, it displays the variables associated with data 0-52, not 53-189. I have a separate function for each form, here is the second one.
// specific drug select list
function showData2(joe) {
p = document.joe.drug2.selectedIndex
if (drugs[p].decrease == "" && drugs[p].increase != ""{
result = "Increased PT/INR"
} else if (drugs[p].decrease != "" && drugs[p].increase != "" ){
result = "Both Increased and Decreased PT/INR responses have been reported"
}else if (drugs[p].decrease != "" && drugs[p].increase == "" ){
result = "Decreased PT/INR"
}
document.joe.output2.value = result
}
The forms all have separate names.
I have tried adding for(var p = 53; p < 189; p++) to this and then you get "Decreased PT/INR" for every option which is also incorrect. As far as I can make out, variables for array 0 are being transposed onto 53, 1 for 54 etc etc.
Does anyone have any ideas about this? Thanks very much.
[sig][/sig]
// specific drug select list
function showData2(joe) {
p = document.joe.drug2.selectedIndex
if (drugs[p].decrease == "" && drugs[p].increase != ""{
result = "Increased PT/INR"
} else if (drugs[p].decrease != "" && drugs[p].increase != "" ){
result = "Both Increased and Decreased PT/INR responses have been reported"
}else if (drugs[p].decrease != "" && drugs[p].increase == "" ){
result = "Decreased PT/INR"
}
document.joe.output2.value = result
}
The forms all have separate names.
I have tried adding for(var p = 53; p < 189; p++) to this and then you get "Decreased PT/INR" for every option which is also incorrect. As far as I can make out, variables for array 0 are being transposed onto 53, 1 for 54 etc etc.
Does anyone have any ideas about this? Thanks very much.
[sig][/sig]