Hi members
i have a textbox9 i want to make it visible if the textbox4="9999"
this is my code :
<script type="text/javascript">
$(document).ready(function () {
$("#<%=TextBox4.ClientID %>").autocomplete({
$('TextBox9').attr('style', request.term == "9999" ? 'display:block;' : 'display:none;'); $('#Label20').attr('style', request.term == "9999" ? 'display:normal;' : 'display:none;');
source: function (request, response) {
$.ajax({
type: "POST",
url: '<%=ResolveUrl("~/ArticleInvestigation.aspx/GetNames2") %>',
data: "{ 'prefix': '" + request.term + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (data) {
response($.map(data.d, function (item) {
return {
label: item.split('-')[0],
val: item.split('-')[1]
}
}))
},
error: function (response) {
alert(response.responseText);
}
});
},
select: function (e, i) {
$("[id$=hfName]").val(i.item.label);
$.ajax({
type: "POST",
url: '<%=ResolveUrl("~/ArticleInvestigation.aspx/GetCountry2") %>',
data: "{ 'name': '" + i.item.label + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (response) {
$("[id*=TextBox3]").val(response.d.split('-')[0]);
$("[id*=TextBox6]").val(response.d.split('-')[1]);
},
error: function (response) {
alert(response.responseText);
}
});
},
minLength: 0
});
});
</script>
i want when the automplete get the click and the value equal to '9999' and the textbox4 receive that value after the
textbox9 should appear or disappear if not equal to '9999'
the is the textbox looks like and the label:
<asp:TextBox ID="TextBox9" runat="server" Width="205px" style="display:none;"></asp:TextBox>
<asp:Label ID="Label20" runat="server" Text="Client divers:" style="display:none;"></asp:Label>
please help