calling auto complete source not working
I have 2 radio button. 1) rdoWindows 2) rdoUnix
i want to the autocomplete source to load only when rdoWindows checked. With this code the auto complete source loading even when rdoUnix is checked. Why is that?
- <script type="text/javascript">
- $(document).ready(
- function () {
-
- $('#HostName').keypress(
-
- function () {
- var value = document.getElementById('HostName').value;
- if ($('#HostName[document_type]').val() != '') {
- if ($("#rdoWindows").is(":checked"))
- {
- $('#HostName').autocomplete(
- {
- source: '/Inventory/WebService/ServerHandler.ashx'
- });
- }
- //alert(value);
- }
- }); // HostName
-
- })
- </script>