I have a Rad Autocomplete Box returning 3 values via web service, I also have several Rad windows on the page. What I am trying to do is get those values from the auto complete box and load a certain Rad Window based on the values returned from the auto complete box. I am having issues getting those values, when I try to grab the values and pass them to the rad window it conflicts with the select function. I was wondering if there is a way to call a function inside a function, if so how do I accomplish this task?
Below is my code.
Below is my code.
function LoadWindow(Type) { var radDash = $find("<%= radDashboard.ClientID%>"); if (Type == 1) { radDash.setUrl("ManageProcessor.aspx"); } else if (Type == 2) { radDash.setUrl("WoTracker.aspx"); } else if (Type == 3) { radDash.setUrl("WoTracker.aspx"); } else if (Type == 4) { radDash.setUrl("WoTracker.aspx"); } else if (Type == 5) { radDash.setUrl("PriorService.aspx"); } else if (Type == 6) { radDash.setUrl("WorkingRecruits.aspx"); } radDash.show(); radDash.maximize(); } </script> <script> $(document).ready(function () { BindControls(); }); function BindControls() { $("#<%= txtSearch.ClientID%>").autocomplete({ source: function (request, response) { $.ajax({ url: "../Recruiting.asmx/FindRecID", data: "{ 'sLookUP': '" + request.term + "' }", dataType: "json", type: "POST", contentType: "application/json; charset=utf-8", dataFilter: function (data) { return data; }, success: function (data) { response($.map(data.d, function (item) { return { label: item.split("-")[0], val: item.split("-")[1], ID: item.split("-")[2] } })) }, error: function (response) { alert(response.responseText); } }); }, select: function (e, i) { $("#<%= HFRecruit.ClientID%>").val(i.item.val); $("#<%= HFId.ClientID%>").val(i.item.ID); }, minLength: 2 // MINIMUM 1 CHARACTER TO START WITH. }); } </script> <link href="../Recuiting.css" rel="stylesheet" /> <link href="../Styles/Styles.css" rel="stylesheet" /> </asp:Content> <asp:Content ID="Content2" ContentPlaceHolderID="BodyContent" Runat="Server"> <telerik:RadAjaxPanel ID="radajax" runat="server"> <div style="width:auto"> <div class="dvGridWrapper"> <asp:HiddenField ID="HFRecruit" runat="server" /><asp:HiddenField ID="HFId" runat="server" /> <asp:TextBox ID="txtSearch" runat="server" Width="260px" ToolTip="Enter Last Name First Name"></asp:TextBox> <asp:TextBoxWatermarkExtender ID="txtSearch_WME" runat="server" TargetControlID="txtSearch" WatermarkText="Lookup Processor" WatermarkCssClass="Watermark"></asp:TextBoxWatermarkExtender><div> <table style="width:90%;margin-right:auto;margin-left:auto;margin-top:20px"> <tr> <td style="width:100%; text-align:center"> <asp:HyperLink ID="hyEnlist" runat="server" onclick="LoadWindow(1)"><asp:Image ID="imgEnlist" runat="server" ImageUrl="../Images/SGT.jpg" CssClass="change_opacity" /></asp:HyperLink> Non-Prior Service <asp:HyperLink ID="hyPrior" runat="server" onclick="LoadWindow(1)"><asp:Image ID="imgPrior" runat="server" ImageUrl="../Images/Corp.jpg" CssClass="change_opacity" /></asp:HyperLink> Prior Service <asp:HyperLink ID="hyOfficer" runat="server" onclick="LoadWindow(2)"><asp:Image ID="imgOff" runat="server" ImageUrl="../Images/Cpt.jpg" CssClass="change_opacity" /></asp:HyperLink> Basic Branch <asp:HyperLink ID="HyWarrant" runat="server" onclick="LoadWindow(3)"><asp:Image ID="imgWarrant" runat="server" ImageUrl="../Images/W03.jpg" CssClass="change_opacity" /></asp:HyperLink> Warrant <asp:HyperLink ID="hyGNPS" runat="server" onclick="LoadWindow(3)"><asp:Image ID="imgGNPS" runat="server" ImageUrl="../Images/glossary.jpg" CssClass="change_opacity" /></asp:HyperLink> Glossory Non Prior Service </td> </tr> <tr> <td style="padding-top:40px; text-align:center"> <asp:HyperLink ID="hyIncentives" runat="server" onclick="LoadWindow(3)"><asp:Image ID="imgIncent" runat="server" ImageUrl="../Images/Incentive.jpg" CssClass="change_opacity" /></asp:HyperLink> Incentive Credit <asp:HyperLink ID="hySpec" runat="server" onclick="LoadWindow(4)"><asp:Image ID="imgSpec" runat="server" ImageUrl="../Images/EFM.jpg" CssClass="change_opacity" /></asp:HyperLink> Specialty Branch <%-- <asp:HyperLink ID="hyRFP" runat="server" onclick="LoadWindow(3)"><asp:Image ID="imgRFP" runat="server" ImageUrl="../Images/recruit.jpg" CssClass="change_opacity" /></asp:HyperLink> Recruit Force Pool --%> <asp:HyperLink ID="hyIST" runat="server" onclick="LoadWindow(3)"><asp:Image ID="imgIST" runat="server" ImageUrl="../Images/IST.png" CssClass="change_opacity" /></asp:HyperLink> Interstate Transfer <asp:HyperLink ID="hyDSE" runat="server" onclick="LoadWindow(3)"><asp:Image ID="imgDSE" runat="server" ImageUrl="../Images/toy2.jpg" CssClass="change_opacity" /></asp:HyperLink> Direct Service Enlistment </td> </tr> </table> <telerik:RadWindow ID="radDashboard" runat="server" InitialBehaviors="Reload" ShowContentDuringLoad="false" CenterIfModal="true" Modal="true" Behaviors="Close" ></telerik:RadWindow> </div> </telerik:RadAjaxPanel> </asp:Content>