RE: [PHP] Trying to keep a dropdown selection sticky

2008-07-05 Thread Michael S. Dunsavage
On Sat, 2008-07-05 at 21:27 -0700, Warren Vail wrote: >foreach ($state_list as $key => $value) { > echo " if($key == $choice) echo " selected"; // now it's > sticky > ;-) > echo "> $value\n"; >} Just another quick ?.. where is $choice coming

RE: [PHP] Trying to keep a dropdown selection sticky

2008-07-05 Thread Michael S. Dunsavage
On Sat, 2008-07-05 at 21:27 -0700, Warren Vail wrote: > When you fail to indicate which item in a select list is "selected" > most > browsers will default to showing the first entry (effectively > unsticking > your choice). > > Good luck ahhh! I was wondering where the "selected" came fro :) T

RE: [PHP] Trying to keep a dropdown selection sticky

2008-07-05 Thread Warren Vail
The selection will stick until you do a form submit. The most common practice in PHP is to update the database with the value from the form or at least save it in a session. After the update you can redisplay your form after fetching the DB contents or getting the selection from the session into