hi,
i am looking for help with script which would take 'text' and 'value' from one drop down and put '(text * 3.2808399)' and 'value' to another drop down on onClick event.
the reason for this is to convert meters to feet as an input for php/mysql.
i did it for text boxes (see code below) but have no clue how to achieve the same for drop downs.
script for text boxes:
function m2f(form) {
var m = parseFloat(form.lm.value);
var f = "";
if (!isNaN(m)) f = Math.round(m * 3.2808399 * 100)/100;
form.tlength.value = f;
}
function f2m(form) {
var f = parseFloat(form.tlength.value);
var m = "";
if (!isNaN(f)) m = Math.round(f * 0.3048* 100)/100;
form.lm.value = m;
}
i am looking for help with script which would take 'text' and 'value' from one drop down and put '(text * 3.2808399)' and 'value' to another drop down on onClick event.
the reason for this is to convert meters to feet as an input for php/mysql.
i did it for text boxes (see code below) but have no clue how to achieve the same for drop downs.
script for text boxes:
function m2f(form) {
var m = parseFloat(form.lm.value);
var f = "";
if (!isNaN(m)) f = Math.round(m * 3.2808399 * 100)/100;
form.tlength.value = f;
}
function f2m(form) {
var f = parseFloat(form.tlength.value);
var m = "";
if (!isNaN(f)) m = Math.round(f * 0.3048* 100)/100;
form.lm.value = m;
}