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. Quote Link to comment 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. Quote Link to comment 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.