Re: Getting variables before the submit button is hit

From: Date: Thu, 01 May 2003 19:33:19 +0000
Subject: Re: Getting variables before the submit button is hit
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-146000@lists.php.net to get a copy of this message
You don't necessarily need JavaScript for this: <? if (isset($_GET) && array_key_exists("s", $_GET)) $MODE = "expanded"; else $MODE = "normal"; // ... if ($MODE == "normal") { ?> <form name="form" action="<?= $_SERVER["SCRIPT_NAME"]; ?>" method="get"> <select name="s"> <option value="yes">Yes</option> <option value="no">No</option> </select> <input type="submit" value="Continue" /> </form> <? } else if ($MODE == "expanded") { ?> <form name="form" action="nextpage.php" method="get"> <select name="s"> <option value="yes">Yes</option> <option value="no">No</option> </select> <input type="text" name="foo" value="Now fill me out!" /> <input type="submit value="Next Page" /> </form> <? } ?> Of course, if you want to have the dropdown selection automatically resubmit the page, without the user having to click "Continue", then you'll have to use JavaScript. Cheers, Morgan On Thursday, May 1, 2003, at 07:59 AM, Gavin Nouwens wrote:
www.google.com Search: javascript drop down menu Not a PHP thing at all! -gav. | -----Original Message----- | From: bob pilly [mailto:bobpilly@yahoo.co.uk] | Sent: Friday, 2 May 2003 12:54 AM | To: php-general@lists.php.net | Subject: [PHP] Getting variables before the submit button is hit | | | Hello all | | I have a drop down list in html that consists of two | choices: | | yes | no | | Thie result of choosing either is assigned to a | variable that is available to the next php page using | $_GET once the 'submit' button is hit. Is there anyway | to get this value on the same page before the submit | button is hit? Im wanting to expand the page and offer | the user more options if they choose 'yes' from the | drop down menu. | | Thanks for any help in advance. | | __________________________________________________ | Yahoo! Plus | For a better Internet experience | http://www.yahoo.co.uk/btoffer | | -- | PHP General Mailing List (http://www.php.net/) | To unsubscribe, visit: http://www.php.net/unsub.php | -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


« previous php.general (#146000) next »