Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Radcombo Client ID

Radcombo Client ID

Scheduled Pinned Locked Moved ASP.NET
javascripthelpcsharpwinformssysadmin
9 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    samerh
    wrote on last edited by
    #1

    Hi all I have a web user control where i have placed a radcombo and an external javascript isiri2901.js. <% @ Control Language="VB" AutoEventWireup="false" CodeFile="AutoComplete.ascx.vb" Inherits="Controls_AutoComplete" %> <%@ Register Assembly="RadComboBox.Net2" Namespace="Telerik.WebControls" TagPrefix="radC" %> <script language='javascript' type='text/javascript' src="../Scripts/isiri2901.js"></script> <script type="text/javascript"> function ChangeTextDirection(obj) { var Name=document.getElementById('<%=RadAutoComplete.ClientID %>'); alert(name.Value); return false; } </script> < radC:RadComboBox ID="RadAutoComplete" runat="server" Width="150px" Height="150px"Skin="ClassicGold" AllowCustomText="True" EnableLoadOnDemand="True"ExpandEffect="Fade" SkinsPath="~/RadControls/ComboBox/Skins" OnClientFocus="ChangeTextDirection(this)" EnableItemBindingExpressions="False" MarkFirstMatch="True"></radC:RadComboBox><asp:RequiredFieldValidator ID="cvalName" ControlToValidate="RadAutoComplete" Display="Dynamic" runat="server">*</asp:RequiredFieldValidator> My issue is that iam not being able to return the client id of the radcombo. It is retuirning undefined. I need to return the ID and use it as a parameter to the JS. Please note that in the same aspx page i might have several web user controls and for each one of those i need to get the id and send it to the JS. Any help and thanks in advance.

    I S 2 Replies Last reply
    0
    • S samerh

      Hi all I have a web user control where i have placed a radcombo and an external javascript isiri2901.js. <% @ Control Language="VB" AutoEventWireup="false" CodeFile="AutoComplete.ascx.vb" Inherits="Controls_AutoComplete" %> <%@ Register Assembly="RadComboBox.Net2" Namespace="Telerik.WebControls" TagPrefix="radC" %> <script language='javascript' type='text/javascript' src="../Scripts/isiri2901.js"></script> <script type="text/javascript"> function ChangeTextDirection(obj) { var Name=document.getElementById('<%=RadAutoComplete.ClientID %>'); alert(name.Value); return false; } </script> < radC:RadComboBox ID="RadAutoComplete" runat="server" Width="150px" Height="150px"Skin="ClassicGold" AllowCustomText="True" EnableLoadOnDemand="True"ExpandEffect="Fade" SkinsPath="~/RadControls/ComboBox/Skins" OnClientFocus="ChangeTextDirection(this)" EnableItemBindingExpressions="False" MarkFirstMatch="True"></radC:RadComboBox><asp:RequiredFieldValidator ID="cvalName" ControlToValidate="RadAutoComplete" Display="Dynamic" runat="server">*</asp:RequiredFieldValidator> My issue is that iam not being able to return the client id of the radcombo. It is retuirning undefined. I need to return the ID and use it as a parameter to the JS. Please note that in the same aspx page i might have several web user controls and for each one of those i need to get the id and send it to the JS. Any help and thanks in advance.

      I Offline
      I Offline
      Imran Khan Pathan
      wrote on last edited by
      #2

      samerh wrote:

      function ChangeTextDirection(obj) { var Name=document.getElementById('<%=RadAutoComplete.ClientID %>');

      You have already object of your combo control in function. :-D

      function ChangeTextDirection(obj)
      {
      alert(obj.Value);
      return false;
      }

      Regard Khan

      please don't forget to vote on the post that helped you.

      S 1 Reply Last reply
      0
      • I Imran Khan Pathan

        samerh wrote:

        function ChangeTextDirection(obj) { var Name=document.getElementById('<%=RadAutoComplete.ClientID %>');

        You have already object of your combo control in function. :-D

        function ChangeTextDirection(obj)
        {
        alert(obj.Value);
        return false;
        }

        Regard Khan

        please don't forget to vote on the post that helped you.

        S Offline
        S Offline
        samerh
        wrote on last edited by
        #3

        Already tried it also. Giving not defined also. Starnge!!!!!!1

        I 1 Reply Last reply
        0
        • S samerh

          Already tried it also. Giving not defined also. Starnge!!!!!!1

          I Offline
          I Offline
          Imran Khan Pathan
          wrote on last edited by
          #4

          Check out ID of control in view source file.What is it?

          please don't forget to vote on the post that helped you.

          S 1 Reply Last reply
          0
          • S samerh

            Hi all I have a web user control where i have placed a radcombo and an external javascript isiri2901.js. <% @ Control Language="VB" AutoEventWireup="false" CodeFile="AutoComplete.ascx.vb" Inherits="Controls_AutoComplete" %> <%@ Register Assembly="RadComboBox.Net2" Namespace="Telerik.WebControls" TagPrefix="radC" %> <script language='javascript' type='text/javascript' src="../Scripts/isiri2901.js"></script> <script type="text/javascript"> function ChangeTextDirection(obj) { var Name=document.getElementById('<%=RadAutoComplete.ClientID %>'); alert(name.Value); return false; } </script> < radC:RadComboBox ID="RadAutoComplete" runat="server" Width="150px" Height="150px"Skin="ClassicGold" AllowCustomText="True" EnableLoadOnDemand="True"ExpandEffect="Fade" SkinsPath="~/RadControls/ComboBox/Skins" OnClientFocus="ChangeTextDirection(this)" EnableItemBindingExpressions="False" MarkFirstMatch="True"></radC:RadComboBox><asp:RequiredFieldValidator ID="cvalName" ControlToValidate="RadAutoComplete" Display="Dynamic" runat="server">*</asp:RequiredFieldValidator> My issue is that iam not being able to return the client id of the radcombo. It is retuirning undefined. I need to return the ID and use it as a parameter to the JS. Please note that in the same aspx page i might have several web user controls and for each one of those i need to get the id and send it to the JS. Any help and thanks in advance.

            S Offline
            S Offline
            Sherin Iranimose
            wrote on last edited by
            #5

            samerh wrote:

            var Name=document.getElementById('<%=RadAutoComplete.ClientID %>');

            samerh wrote:

            alert(name.Value);

            Name or name? :doh:

            EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE. How to post a question

            S 1 Reply Last reply
            0
            • I Imran Khan Pathan

              Check out ID of control in view source file.What is it?

              please don't forget to vote on the post that helped you.

              S Offline
              S Offline
              samerh
              wrote on last edited by
              #6

              In source it is like this <input type="text" id="txtFirstName_RadAutoComplete_Input" name="txtFirstName$RadAutoComplete_Input" value="" class="ComboBoxInput_ClassicGold" style="width:150px;" tabindex="3"></input>

              I 1 Reply Last reply
              0
              • S Sherin Iranimose

                samerh wrote:

                var Name=document.getElementById('<%=RadAutoComplete.ClientID %>');

                samerh wrote:

                alert(name.Value);

                Name or name? :doh:

                EVEN THE WORD IMPOSSIBLE SAYS I M POSSIBLE. How to post a question

                S Offline
                S Offline
                samerh
                wrote on last edited by
                #7

                NO, Name in both & still not working. Thanks anyway

                1 Reply Last reply
                0
                • S samerh

                  In source it is like this <input type="text" id="txtFirstName_RadAutoComplete_Input" name="txtFirstName$RadAutoComplete_Input" value="" class="ComboBoxInput_ClassicGold" style="width:150px;" tabindex="3"></input>

                  I Offline
                  I Offline
                  Imran Khan Pathan
                  wrote on last edited by
                  #8

                  Okay. Now check ID in function like this alert(obj.id); If it gives undefined then try with

                  alert(document.getElementById('txtFirstName_RadAutoComplete_Input').value);

                  Regard Khan

                  please don't forget to vote on the post that helped you.

                  S 1 Reply Last reply
                  0
                  • I Imran Khan Pathan

                    Okay. Now check ID in function like this alert(obj.id); If it gives undefined then try with

                    alert(document.getElementById('txtFirstName_RadAutoComplete_Input').value);

                    Regard Khan

                    please don't forget to vote on the post that helped you.

                    S Offline
                    S Offline
                    samerh
                    wrote on last edited by
                    #9

                    Imran Khan Pathan wrote:

                    alert(obj.id);

                    It gives undefined i already tried it.

                    Imran Khan Pathan wrote:

                    alert(document.getElementById('txtFirstName_RadAutoComplete_Input').value);

                    This could be true if i know the name of each control, but note that this is a web user control that iam dropping in the page several times sometimes. In this special case it is 'txtFirstName_RadAutoComplete_Input' but in the same page there are 2-3-4 more controls. Is there a general methos to read the radcombo in the web user control instead of referring to it in each page alone. thanks

                    1 Reply Last reply
                    0
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    • Login

                    • Don't have an account? Register

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • World
                    • Users
                    • Groups