Jump to content

[SOLVED] when i enter cubic feet i want cubic meters


brown2005

Recommended Posts

echo"<form method='post' action=''>";

echo"<input type='text' name='CubicFeet'>";

echo"<br><br>";

echo"<input type='text' name='CubicMeters'>";

echo"</form>";

 

that is my form, now when i enter a value in the input CubicFeet i want to do

 

CubicFeet x 0.0283168466 and then put the value in CubicMeters.

 

any ideas please?

 

 

try[codeg<script language="JavaScript" >
function to_m(){
	var f = document.getElementById('f').value;
	var m = f*0.0283168466;
	document.getElementById('m').value = m;
}
function to_f() {
	var m = document.getElementById('m').value;
	var f = m/0.0283168466;
	document.getElementById('f').value = f;
}
</script>

<form method='post' action=''>
<input type='text' name='CubicFeet' id='f' onkeyup='to_m()'> CubicFeet <br />
<input type='text' name='CubicMeters' id='m' onkeyup='to_f()'> CubicMeters
</form>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.