Radcombo Client ID
-
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.
-
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.
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.
-
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.
-
Check out ID of control in view source file.What is it?
please don't forget to vote on the post that helped you.
-
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.
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
-
Check out ID of control in view source file.What is it?
please don't forget to vote on the post that helped you.
-
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
-
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>
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.
-
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.
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