athanasius
06-27-2003, 11:55 AM
I am trying to get the following function to change a couple of form fields when the onchange() action occurs. It does the first action but tells me that "Cannot assign to function result". If I take out the parseFloat function in the If statement, the drop down works once and then won't change anything else at all. If I leave it in, the first part of the function above the if statement works but the if statement gives the error message. Help!
function changeOptions(form) {
var laminationprice = (parseFloat(form.sheetprice.value)-parseFloat(form.Lamination.options[form.Lamination.selectedIndex].value))*parseFloat(form.qty.value);
form.holycardprice.value = laminationprice.toFixed(2);
if (parseFloat(form.Lamination.options[form.Lamination.selectedIndex].value) = #Variables.LaminatedPrice#) {
form.Feature_1_2.value = '#Variables.Laminated_Pk#';
}
else {
form.Feature_1_2.value = '#Variables.Unlaminated_Pk#';
}
}
function changeOptions(form) {
var laminationprice = (parseFloat(form.sheetprice.value)-parseFloat(form.Lamination.options[form.Lamination.selectedIndex].value))*parseFloat(form.qty.value);
form.holycardprice.value = laminationprice.toFixed(2);
if (parseFloat(form.Lamination.options[form.Lamination.selectedIndex].value) = #Variables.LaminatedPrice#) {
form.Feature_1_2.value = '#Variables.Laminated_Pk#';
}
else {
form.Feature_1_2.value = '#Variables.Unlaminated_Pk#';
}
}