views:

477

answers:

2

I am simply trying to fill a Rad Text box with server data in javascript. The data is placed inside of the textbox but it is not visible until i click on the Rad Textbox.

  function pickItem(name, sku, plu, nameBox, sBox, pBox) {

                sBox.value = sku;
                pBox.value = plu;
                nameBox.value = name;
                $find('mdlPopup').hide();
            }

I'm sending the parameter in code for the click of a button inside of a Gridview as follows:

  button.Attributes.Add("onClick", string.Format("pickItem('{0}',{1},{2},{3},{4},{5});",
                e.Row.Cells[0].Text.Trim(), e.Row.Cells[1].Text.Trim(), e.Row.Cells[2].Text.Trim(), FormViewAccident.FindControl("prodBox").ClientID,
                FormViewAccident.FindControl("SBox").ClientID, FormViewAccident.FindControl("PBox").ClientID));

Again, this works except for the fact that i have to click inside of the textbox. It works perfect if i use a regular asp.net textbox which is inconsistent for this project

+1  A: 

You need to use Telerik's client-side API to change the value.

Change nameBox.value = name to nameBox.set_value(name).

For more information, see the demo.

SLaks
I thought the same exact thing, but i continue to receive this error:' Object doesn't support this property or method'
Eric
Change it to `set_value`. The documentation is wrong; you should look at the demo.
SLaks
This was also a correct answer. +1
Eric
+2  A: 

Also make sure that nameBox is a reference to the client RadTextBox object, not its DOM element (hint: use the $find method instead of $get).

Dick Lampard