在Java脚本中获取Template值 [英] Get the Template value in java Script

查看:57
本文介绍了在Java脚本中获取Template值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取Template字段中textBox的值?

How I get the value of textBox which is in Template field ?

<asp:TemplateField HeaderText="Weightage">
  <ItemTemplate>
    <asp:TextBox ID="txtWtg" runat="server" height="20px" Width="43px">
    </asp:TextBox>
  </ItemTemplate>
</asp:TemplateField>





function checkKRA()
{
  if (document.getElementById(txtWtg).value == '''';)
  {
    alert(''The KRA can not empty'');
    return false;
  }
}



但是我无法读取textBox的值.

请感谢您的帮助?



But I can''t read the value of textBox.

Kindly appreciate your help ?

推荐答案

这是datagrid/gridview中的模板字段,因此它将生成不规则的ID,因此请尝试.

使用javascript获取多项目gridview模板字段中的文本框值 [
It''s a template field inside datagrid/gridview so it will generate irregular IDs so try this.

Get textbox value in a multiple item gridview templatefield using javascript[^]


这篇关于在Java脚本中获取Template值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆