javascript - How to change System of Measurements on a Legacy Form -
javascript - How to change System of Measurements on a Legacy Form -
i have next form:
right now, values entered using english language scheme of measurements. need allow entry of metric values well.
here thinking:
add drop-downsystem unit select box
english/metric depending on state of system unit select box
, alter names of physical properties (gpm, psi, etc) question:
so let's add together select box english/metric. how read state of box , how implement label-changing english language metric system? i.e. gpm
-> m3h
(meter cubed per hour), etc.
<select name="unit_system" id="unit_system"> <option value="english">english</option> <option value="metric">metric</option> </select> <script type="text/javascript"> $("#unit_system").change(function() { if ($('#unit_system').val() == "english") { $('.input_gpm').html('gpm'); } else if ($('#unit_system').val() == "metric") { $('.input_gpm').html('m3h'); } }); </script> <td class="input_gpm"><b>gpm</b></td>
javascript jquery
Comments
Post a Comment