RE: Redisplaying information from a HTML form

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Is there a way I can make these boxes and buttons 
> retain their value?

Without a code example, I am forced to give a generic answer.  Here's one
way to do it:

<? 
$selection=5; // User previously picked option 5
$ddselection[$selection]=' selected ';
?>

<select name="D1">
    <option<? echo $ddselection[1]; ?> value="1">Option 1</option>
    <option<? echo $ddselection[2]; ?> value="2">Option 2</option>
    <option<? echo $ddselection[3]; ?> value="3">Option 3</option>
    <option<? echo $ddselection[4]; ?> value="4">Option 4</option>
    <option<? echo $ddselection[5]; ?> value="5">Option 5</option>
    <option<? echo $ddselection[6]; ?> value="6">Option 6</option>
    <option<? echo $ddselection[7]; ?> value="7">Option 7</option>
    <option<? echo $ddselection[8]; ?> value="8">Option 8</option>
</select>


JM

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux