Click here to Skip to main content
15,917,568 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
example
<select name=username>
<option value=Borneo Sabah>Borneo Sabah</option>
</select>
Hot get/show Borneo Sabah not Borneo
Posted

1 solution

Put Borneo Sabah inside quotes:
HTML
<select name=username>
<option value="Borneo Sabah">Borneo Sabah</option>
</select>

Quotes around an attribute value are not required in HTML, but they are necessary in some cases such as when you have to put a space inside your attribute value.

Unquoted attribute values must also not contain any of these characters:

", ', =, >, <, or `. Sure, you can have %, or # or £, but no backticks please!


If you want to do set the attribute value from PHP, you have to escape the quote[^] (using \"):
PHP
echo"<option value=\"".$rows[0]."\">".$rows[0]."</option>";
 
Share this answer
 
v3
Comments
JaironLanda 7-Sep-14 12:36pm    
HOW about in php?
<td><br>Depature From:</br><Select name="dpt_from" maxlength="100000">
<option value="default">--</option>
<!--?php<br /--> while($rows=mysql_fetch_array($result,MYSQL_BOTH))
echo"<option value=".$rows[0].">".$rows[0]."</option>";
}
}
?>
Thomas Daniels 7-Sep-14 12:40pm    
I edited my answer.
JaironLanda 7-Sep-14 12:44pm    
Thanks so much...
Thomas Daniels 7-Sep-14 12:45pm    
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900