This Search Form works successfully, except in Safari the Optional sub-category only shows Optional as a choice (after a Category is selected), although via PC additional sub-category choices are available to choose.
<form method="get" action="../search.php">
<input id="keyword" name="keyword" value="SEARCH WORDS" onfocus="if (this.value=='SEARCH WORDS') {this.value=''; this.style.color='#000000';}" onclick="clickclear(this, 'Enter Search Words')" onblur="clickrecall(this,'Enter Search Words')" value="" />
<select size="1" name="channel" class="dropdown" />
<option value="">SELECT</option>
<option value="All">ALL</option>
<option value="1">Channel1</option>
<option value="2">Channel2</option>
</select>
<select size="1" name="sub_category" class="dropdown" />
<option value="All">OPTIONAL</option>
</select>
<input type="submit" value="VIEW"/>
</form>
<script>
$(document).ready(function() {
$("select[name='channel']").change(function() {
var channel_id = $(this).val();
console.log(channel_id);
$.ajax({
type: "GET",
url: "/ajax.php",
data: "channel_id="+channel_id,
success: function(data) {
data = JSON.parse(data);
$("select[name='sub_category']").html('<option value="All">Optional</option>');
for(i = 0; i < data.length; i ++) {
$("select[name='sub_category']").append("<option value='"+data[i]["sub_channel_id"]+"'>"+data[i]["sub_channel_name"]+"</option>");
}
}
});
});
});
</script>
Any ideas/suggestions to try to remedy that, will be appreciated.