Yes, instead of getting a reference to the textbox, you can get a reference
to the <td> and use it's innerText property. In this case you might not need
an item template in the first case. Just make a BoundColumn bound to KgFee.
The values will go straight inside the <td>s. The grid will render as a
table and you should be able to loop through the rows and cells collections
in javascript. Or you can consider replacing the grid with a repeater with
item template something like
<tr>
<td class="ep" id=kf name=kf >'<%# DataBinder.Eval(Container,
"DataItem.KgFee") %>'</td>
</tr>
--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
[quoted text, click to view] "Hamed" <hamedarab@yahoo.com> wrote in message
news:%23$mZUE0oGHA.3820@TK2MSFTNGP05.phx.gbl...
> The page has some controls on the text and use it for some calculations.
> Is it possible to get the value of some non INPUT tags such as the <td>my
> integer value</td>?
>
> I am using some JavaScript code like the following:
>
> function kp()
> {
> var number=document.activeElement.id.substr(j.index,k);
>
> var ctl = 'gd__ctl' + number + '_kf';
> var myValue = Form1.all.namedItem(ctl);
>
> //do some manipulation with myValue.
> ...
>
> }
>
>
>
>
> "Eliyahu Goldin" <removemeegoldin@monarchmed.com> wrote in message
> news:u3tni0zoGHA.3584@TK2MSFTNGP03.phx.gbl...
>> 2. No, not in standard CSS. But you can make a simple javascript that
>> will find all inputs that need to be readonly and set their readOnly
>> property to true.
>>
>> 3. Absolutely no.
>>
>> Just wandering, may be you could use labels or literal content instead of
>> readonly textboxes?
>>
>> --
>> Eliyahu Goldin,
>> Software Developer & Consultant
>> Microsoft MVP [ASP.NET]
>>
>> "Hamed" <hamedarab@yahoo.com> wrote in message
>> news:eqml2cyoGHA.4184@TK2MSFTNGP04.phx.gbl...
>>> Hello
>>>
>>> I have a DataGrid object in my ASP.NET page that has the following
>>> template column. When I put the "readonly" attribute in the INPUT tag,
>>> it generates readonly="".
>>>
>>> <asp:TemplateColumn HeaderText="Kg Price" HeaderStyle-Width="5%">
>>> <ItemTemplate><INPUT class="ep" id=kf readOnly value='<%#
>>> DataBinder.Eval(Container, "DataItem.KgFee") %>' name=kf
>>> runat="server"></ItemTemplate>
>>> </asp:TemplateColumn>
>>>
>>>
>>> As there is a lot of rows in the DataGrid, I want to remove three
>>> unneeded attributes:
>>> 1- I want to remove the [=""] from the end of generated "readonly"
>>> attribute in the page.
>>> 2- Is it possible to make CSS codes for ReadOnly attribute?
>>> 3- Is it possible to remove the type="text" part of the INPUT tag or
>>> move it to the CSS code?
>>>
>>> Bests
>>> Hamed
>>>
>>
>>
>
>