LittleRipples Project
Monday, 21 April 2008
making
selected value dynamic from mysql database
The Problem: when going into the editlisting page the drop down lists default to there original settings. Therefore if the user doesn't fully check this everytime they will change their details
The solution:
in the HTML of the form the
value has a SELECTED value. we need to let the form know which is the right option value to be selected.
#################
landlords/editlisting.php
CONSIDER THE TAG
OPTION VALUE="1" SELECTED
instead of 'selected' we need to have some php on every option that works out if the value of bed is 1 if so then make this item selected.
our value is held in $row["bed"]
[hack]
$bed = $row["bed"];if ($bed == 1){
echo 'SELECTED';
}
[/hack]
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment