<select id="countryselect" name="country>
<option value="US">United States</option>
.
.
</select>
<select id="cityselect" name="city"></select>
this is html code and
$.cityselect = function(){
var td= $('#countryselect').val();
$.ajax({
type: "POST",
url: "action.php",
data: {'countrytd':td},
success: function(e){
$('#cityselect').html(e);
},
});
};
this is my chained select function. Mysql process that creating options in action.php.
Here is the thing, when i use this function, the result is that
<select id="cityselect" name="city">
<option value></option> // empty value
<option value="1">New York</option>
<option value="2">Broadway</option>
</select>
i dont want empty value because i need that information. There is no empty value that i wrote to anywhere. There is no problem in php file because when i changed this
$('#cityselect').html(e);
to this
$('#cityselect').html('<option value="1">name</option>');
it adds blank value to top anyway.
how can i disable that process or how can i remove blank value after operation.
Also when i use 'e' that comes from success it includes metatags and some other head elements that i use for language character set in action.php . How can i clean these?