Hi,
I have three dropdown select option fields on a html form called myform.
They are hours_values (00 - 23), minutes_values (00 - 59) and day_segment_select (1.00,0.75,0.50,0.25).
when then user changes the day_segment_select the other two dropdowns change depending on values on other fields.
This works when the values change to values other than what they were originally. eg.
hours_values = 08 minutes_values 02 change the day_segment_select and the value changes to hours_values = 10 and minutes_values 10 works. If the user then selects something from the day_segment_select that will cause the values of the other two drop downs to revert to the original values then these list are set to null.
This is the function
function set_hours_minutes()
{
var hours_value
var minutes_value
var segment_value = myform.day_segment_select[myform.day_segment_select.selectedIndex].value;
switch (segment_value)
{
case "1.00":
hours_value = myform.full_day_segment_hours.value;
minutes_value = myform.full_day_segment_minutes.value;
break;
case "0.75":
hours_value = myform.three_quarter_day_segment_hours.value;
minutes_value = myform.three_quarter_day_segment_minutes.value;
break;
case "0.50":
hours_value = myform.half_day_segment_hours.value;
minutes_value = myform.half_day_segment_minutes.value;
break;
case "0.25":
hours_value = myform.quarter_day_segment_hours.value;
minutes_value = myform.quarter_day_segment_minutes.value;
break;
default:
break;
}
alert("hours " + hours_value);
alert("minutes " + minutes_value);
myform.hours_values.value = hours_value;
myform.hours_values.text = hours_value;
myform.minutes_values.value = minutes_value;
myform.minutes_values.text = minutes_value;
}
the alert is bringing back the values I would expect.
Anthony.
I have three dropdown select option fields on a html form called myform.
They are hours_values (00 - 23), minutes_values (00 - 59) and day_segment_select (1.00,0.75,0.50,0.25).
when then user changes the day_segment_select the other two dropdowns change depending on values on other fields.
This works when the values change to values other than what they were originally. eg.
hours_values = 08 minutes_values 02 change the day_segment_select and the value changes to hours_values = 10 and minutes_values 10 works. If the user then selects something from the day_segment_select that will cause the values of the other two drop downs to revert to the original values then these list are set to null.
This is the function
function set_hours_minutes()
{
var hours_value
var minutes_value
var segment_value = myform.day_segment_select[myform.day_segment_select.selectedIndex].value;
switch (segment_value)
{
case "1.00":
hours_value = myform.full_day_segment_hours.value;
minutes_value = myform.full_day_segment_minutes.value;
break;
case "0.75":
hours_value = myform.three_quarter_day_segment_hours.value;
minutes_value = myform.three_quarter_day_segment_minutes.value;
break;
case "0.50":
hours_value = myform.half_day_segment_hours.value;
minutes_value = myform.half_day_segment_minutes.value;
break;
case "0.25":
hours_value = myform.quarter_day_segment_hours.value;
minutes_value = myform.quarter_day_segment_minutes.value;
break;
default:
break;
}
alert("hours " + hours_value);
alert("minutes " + minutes_value);
myform.hours_values.value = hours_value;
myform.hours_values.text = hours_value;
myform.minutes_values.value = minutes_value;
myform.minutes_values.text = minutes_value;
}
the alert is bringing back the values I would expect.
Anthony.