Here is my code,
<script language="javascript" type="text/javascript">
jQuery(function(){
$("#cname").autocomplete("list1.jsp");
});
$(document).ready(function(){
$('div.ajaxx').delegate("#cname","change",function(){
var env_id=ui.item.value;
$.ajax({
url:'dc_ajax.jsp',
type:'POST',
data:{count:env_id},
success:function(data){
$('div.dc').html(data);
},
error:function(){
$('div.dc').html('<p class="error"><strong>Oops!</strong> Try that again in a few moments.</p>');
}
});
});
});
</script>
In this code, I want to use value select from autocomplete to call a ajax. but when I tried to use it, it shows null value but on redirecting to another page, it shows selected value. So how to use that value in javascript?
Here is my html code where ajax call
<div class='ajaxx'>
<span style="font-family: 'Terminal Dosis Light', sans-serif;font-size: 20px"> <b>Select Customer :</b></span>
<input type="text" id="cname" name="cname" class="input_text" value="" required />
<div class='dc' style="margin-top: 1em;"></div>
</div>