Hi,
I'm using some code to create drop down lists from my db. The problem is when I try to pass the result from the form, for any result that has a space in it, the 'value'
portion of the tag is being truncated.
for example...
Should be:
<option value="Extra Large">Extra Large</option>
Displays:
<option value="Extra">Extra Large</option>
As you can see it displays ok on the drop down list, but the values are being cut. I'm passing the exact same variable to the value and the part that is displaying so I don't get it.
Here's the snippet:
echo "<select name=\"input\">\n";
echo "<option value=\"\">SELECT</option>\n";
while ($b=mysql_fetch_array($bresult)) {
$term = ucwords ($b[$q]);//$q is a counter
echo "<option
value=\"$term\">$term</option>\n";
}
echo "</select><br><input type=image src=\"http://www.zanevideo.com/images/go.gif\" border=0 value=submit>\n";
echo "</td></tr></table>\n";
echo "<input type=hidden name=searchby value=$searchby>\n";
echo "</form>\n";
I'm guessing there's some way to compensate for spaces, but I can't seem to figure it out. I've tried using ereg_replace to change the spaces to to ascii characters, but no luck.
Tool