I am going to submit form OnChange but its not working for me. I am using php loop to get values in options under select drop-down.
Here is the code:
<select id="agnt_name" name="agnt_name" style="font-weight:bold; font-size:13px; height:25px; vertical-align:central;" onchange="this.form.submit()">
<?php
$agentname_query = mysql_query("SELECT id, lname, fname FROM `agent` order by fname");
while($agentname_fetch = mysql_fetch_array($agentname_query)){
$agentname_id = $agentname_fetch['id'];
$agentname_fname = $agentname_fetch['fname'];
$agentname_lname = $agentname_fetch['lname'];
?>
<option <?php if($selected_agent == $agentname_id) { echo 'selected="selected"'; } ?> value="<?php echo $agentname_id;?>" ><?php echo strtoupper($agentname_fname);?> <?php echo strtoupper($agentname_lname);?></option>
<?php
}
?>
</select>
if I just submit the form without changing the value in select drop-down its not submitting the form because I did not change the value so I tried to enter one more option like:
<option value="">Select One</option>
It is still not working from my end.. using auto fill for these options jquery is bellow:
<script type="text/javascript" charset="utf-8">
(function($){
$(function(){
$('#agnt_name').selectToAutocomplete();
});
})(jQuery);
</script>
Thanks