This is a migrated thread and some comments may be shown as answers.
RadTextBox collection access in javascript
13 Answers 71 Views
This is a migrated thread and some comments may be shown as answers.
Ken Jones
Top achievements
Rank 1
Ken Jones asked on 20 Jan 2011, 05:15 PM
Hello,

I have come across the following javascript code to access a collection of ComboBox objects:

var combos = Telerik.Web.UI.RadComboBox.ComboBoxes;

Is there an equivalent for RadTextBoxes?

Thanks,

Ken Jones

13 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 21 Jan 2011, 09:16 AM
Hello Ken,

As far as I know,  there is no such direct method to get the RadTextBox collection. You can try the following approach to meet your scenario.

JavaScript:
function GetRadTextBoxes()
{
    var allRadTextBoxes = [];
    var allRadControls = $telerik.radControls;
    for (var i = 0; i < allRadControls.length; i++)
    {
        var element = allRadControls[i];
        var isRadTextBox = element instanceof Telerik.Web.UI.RadTextBox;
        if (isRadTextBox)
         {
            Array.add(allRadTextBoxes, element);
         }
    }
 alert(allRadTextBoxes.length);
}

Thanks,
Shinu.
0
Ken Jones
Top achievements
Rank 1
answered on 24 Jan 2011, 04:34 PM
Hello,

Thanks for the repsonse, that works for me, I now need to be able to test on the client id of each of the textboxes to know whether to update them or not, the following link does not seem to inform me as to how I get the id.

http://www.telerik.com/help/aspnet-ajax/input_clientsideradtextbox.html

Thanks,

Ken
0
Maria Ilieva
Telerik team
answered on 27 Jan 2011, 02:07 PM
Hello Ken Jones,

Please revise the following help topic:
http://www.telerik.com/help/aspnet-ajax/input_clientsidebasics.html

Kind regards,
Maria Ilieva
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Maria Ilieva
Telerik team
answered on 27 Jan 2011, 02:07 PM
Hello Ken Jones,

Please revise the following help topic:
http://www.telerik.com/help/aspnet-ajax/input_clientsidebasics.html

Kind regards,
Maria Ilieva
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Ken Jones
Top achievements
Rank 1
answered on 27 Jan 2011, 04:40 PM
Hello,

Thanks again for your reply but as far as I can see, the link that you suggested does not answer my question.

Ta,

Ken
0
Shinu
Top achievements
Rank 1
answered on 28 Jan 2011, 07:32 AM
Hello Ken,

You can try the following approach to access the ClientID of the RadTextBoxes.

JavaScript:
for (var i = 0; i < allRadTextBoxes.length; i++)
    {
        var txt = allRadTextBoxes[i];
        alert(txt._clientID);
    }

Thanks,
Shinu.
0
Ken Jones
Top achievements
Rank 1
answered on 28 Jan 2011, 09:52 AM
Thanks, I will give that a go.

Ta,

Ken
0
Ken Jones
Top achievements
Rank 1
answered on 28 Jan 2011, 11:47 AM
Hello,

This works thanks. Unfortunately the next thing I tried doesnt work now. I need to be able to access the updated value of the text box from server side code. I have acheived this with a RadListBox using trackChanges() and commitChanges(). When I use these methods with my RadTextBox I get the message 'Object doesn't support this prpoerty or method'. Is there another way to acheive this?

Thanks again,

Ken
0
Ken Jones
Top achievements
Rank 1
answered on 31 Jan 2011, 03:07 PM
Hello,

Does anybody have any suggestions for this?

Ta,

Ken
0
Maria Ilieva
Telerik team
answered on 01 Feb 2011, 02:38 PM
Hello Ken Jones,

You can get the new value from the arguments of the server TextChanged event of the RadTextBox.
If you need to access it on the client please use get_textBoxValue()


Regards,
Maria Ilieva
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Maria Ilieva
Telerik team
answered on 01 Feb 2011, 02:38 PM
Hello Ken Jones,

You can get the new value from the arguments of the server TextChanged event of the RadTextBox.
If you need to access it on the client please use get_textBoxValue()


Regards,
Maria Ilieva
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Ken Jones
Top achievements
Rank 1
answered on 01 Feb 2011, 03:32 PM
Thanks for the update.

I think that part of the problem here is that my RadTextBox is sat inside the FormTemplate of a RadGrid, I am accessing the value in the UpdateCommand method server-side but thefollowing code results in the original value being stored in site.Client and not the value that has been updated client side.

RadTextBox uiTxtClient = (RadTextBox)editedItem.FindControl("uiTxtClient");
site.Client = uiTxtClient.Text;

Let me know if anything needs changing.

Ken
0
Ken Jones
Top achievements
Rank 1
answered on 01 Feb 2011, 03:40 PM
I have now worked the problem out to be that my text box is read only....
Tags
Input
Asked by
Ken Jones
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Ken Jones
Top achievements
Rank 1
Maria Ilieva
Telerik team
Share this question
or