dekonstruct Posted March 5, 2007 Share Posted March 5, 2007 Hello, I've got a form that is built using php. It counts backwards from todays date to zero and each number is a selection. I then pass this number variable to another page called num.php I was wondering if there's a way to get rid of that submit button and still be able to pass my php variables to num.php. I've tried some things in javascript but it didn't pass the php variables along with it. Here's the code for the form: <form method="post" action="num.php"> <select name="num"> <?php $y = date('z') + 1; for($x = 1; $x < $y; $x++) { print "<option>$x</option>\n"; } ?> <input type="submit" value="submit" name="submit"> </select> </form> Here's the code on num.php in case you need it: <?php session_start(); $_SESSION['dailies'] = $_POST["num"] - 1; ?> Many thanks in advance. Link to comment https://forums.phpfreaks.com/topic/41336-submitting-forms/ Share on other sites More sharing options...
jcbarr Posted March 5, 2007 Share Posted March 5, 2007 You have to submit the form somehow. I think you can use an onSelect javascript function to automatically submit the form when a user selects an option. Try the javascript forum, they will be able to help you much more than we will. Link to comment https://forums.phpfreaks.com/topic/41336-submitting-forms/#findComment-200321 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.