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? Quote 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. Quote 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> Quote 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... Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.