Select Box
Posted: Tue Nov 02, 2004 1:23 am
Hi
I have an input form into a database. Some of the fields are stored via a select box. This works fine. Then I need to have an output form where the fields that are stored with the select box is also shown in the output form with the select box. Problem is, i can get it to show in a normal textbox, but when i try the select box, it doesnt show which value was selected in the input form.
My select box has the following values: Canvas, Exhibition, Phone-In and so forth.
All the fields in the database is selected in the output form and i put them into an array.
Eg. Listing No is a textbox and Source is a select box:
the code is:
The listing no works fine. Just cant get the form to select the selected value from the database.
Could somebody maybe help me on this?
Oh another quick question i have is it possible for the values that was stored in a textbox, to be shown in a checkbox. My professor told us that the input form should have textboxes, then with the output form, he wants checkboxes to show if their was something entered. or something.
Like if the user entered that there was a jacuzzi at the residence, then the output form should have a checked checkbox for jacuzzi. (but i dont see how this is possible since the textbox can save yes there was a jacuzzi or no there wasnt)
Thanx for all the help
Mystra
I have an input form into a database. Some of the fields are stored via a select box. This works fine. Then I need to have an output form where the fields that are stored with the select box is also shown in the output form with the select box. Problem is, i can get it to show in a normal textbox, but when i try the select box, it doesnt show which value was selected in the input form.
My select box has the following values: Canvas, Exhibition, Phone-In and so forth.
All the fields in the database is selected in the output form and i put them into an array.
Eg. Listing No is a textbox and Source is a select box:
the code is:
Code: Select all
$query=" SELECT * FROM property WHERE ListingNo='$ListingNo'";
$result=mysql_query($query);
$num=mysql_num_rows($result);
while ($row = mysql_fetch_array($result)){
echo 'echo '<input type="text" name="ListingNo" size="20" value="'.$rowїListingNo].'">';
echo '<SELECT class="clsselectbox" name="cboSource" size="1" value="'.$rowїSource].'">
<OPTION></OPTION><OPTION>Canvas</option><OPTION>Exhibition</option><OPTION> Phone-In</option>';
}Could somebody maybe help me on this?
Oh another quick question i have is it possible for the values that was stored in a textbox, to be shown in a checkbox. My professor told us that the input form should have textboxes, then with the output form, he wants checkboxes to show if their was something entered. or something.
Like if the user entered that there was a jacuzzi at the residence, then the output form should have a checked checkbox for jacuzzi. (but i dont see how this is possible since the textbox can save yes there was a jacuzzi or no there wasnt)
Thanx for all the help
Mystra