brown2005 Posted April 11, 2007 Share Posted April 11, 2007 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? Link to comment https://forums.phpfreaks.com/topic/46559-solved-when-i-enter-cubic-feet-i-want-cubic-meters/ Share on other sites More sharing options...
AndyB Posted April 11, 2007 Share Posted April 11, 2007 This is a javascript question, despite the code being in php, thus in the wrong forum. Link to comment https://forums.phpfreaks.com/topic/46559-solved-when-i-enter-cubic-feet-i-want-cubic-meters/#findComment-226671 Share on other sites More sharing options...
sasa Posted April 11, 2007 Share Posted April 11, 2007 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> Link to comment https://forums.phpfreaks.com/topic/46559-solved-when-i-enter-cubic-feet-i-want-cubic-meters/#findComment-226675 Share on other sites More sharing options...
brown2005 Posted April 11, 2007 Author Share Posted April 11, 2007 thanks mate, sorted... Link to comment https://forums.phpfreaks.com/topic/46559-solved-when-i-enter-cubic-feet-i-want-cubic-meters/#findComment-226794 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.