lotrfan Posted October 15, 2007 Share Posted October 15, 2007 I have a PHP form that users can put in floats, integers, etc. that performs calculations. My PHP then uses $_REQUEST to get the values. However I would like to allow them to reset the values in the form as well as the text the PHP echoes to the page by clicking "RESET" button. I included an input type for 'reset' but it does not work. Any ideas? Link to comment https://forums.phpfreaks.com/topic/73264-how-can-i-reset-my-php-form-and-page/ Share on other sites More sharing options...
lotrfan Posted October 15, 2007 Author Share Posted October 15, 2007 Oh, almost forgot, here's the script for the forms... <form method="post" action="hypotenuse.php" onKeyPress="return numbersonly(this, event)"> <p>Side a</p><input name="side_a" type="text" /><br /> <p>Side b</p><input name="side_b" type="text" /><br /> <p>Side c</p><input name="side_c" type="text" /><br /> <p>Angle A</p><input name="angle_a" type="text" /><br /> <p>Angle B</p><input name="angle_b" type="text" /><br /> <p>Angle C</p><input name="angle_c" type="text" /><br /> <input type="submit" value="GO!" /> <input type="reset" value="Reset" /> </form> and PHP side... $side_a = $_REQUEST[side_a]; $side_b = $_REQUEST[side_b]; $side_c = $_REQUEST[side_c]; $angle_a = $_REQUEST[angle_a]; $angle_b = $_REQUEST[angle_b]; $angle_c = $_REQUEST[angle_c]; Link to comment https://forums.phpfreaks.com/topic/73264-how-can-i-reset-my-php-form-and-page/#findComment-369645 Share on other sites More sharing options...
jd2007 Posted October 15, 2007 Share Posted October 15, 2007 it works for me.... Link to comment https://forums.phpfreaks.com/topic/73264-how-can-i-reset-my-php-form-and-page/#findComment-369751 Share on other sites More sharing options...
lotrfan Posted October 15, 2007 Author Share Posted October 15, 2007 Well, that is great...but are you using $_REQUEST? Maybe I should change the associative array.... I tried that before and it didn't work so well, though. Any ideas? Link to comment https://forums.phpfreaks.com/topic/73264-how-can-i-reset-my-php-form-and-page/#findComment-369841 Share on other sites More sharing options...
lotrfan Posted October 16, 2007 Author Share Posted October 16, 2007 *bump* Link to comment https://forums.phpfreaks.com/topic/73264-how-can-i-reset-my-php-form-and-page/#findComment-370371 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.