I’m using this to populate a dropdown:
$result = mysql_query("SELECT user from `users` order by user asc") or die(mysql_error());
echo '<select name="user" class="user">';
while ($row = mysql_fetch_array($result)) {
echo "<option value=".$row['user'].">".$row['user']."</option>";
}
echo '</select>';
But the source is this:
<select name="user" class="user"><option value=joe bloggs>joe bloggs</option>
So when i do this:
var user = $('.user').val();
It only sees “joe” not “joe bloggs”?? Any ideas
Corrected for you 🙂