如何使用jquery获取多行文本框的值 [英] How to fetch Multiline textbox value using jquery

查看:2311
本文介绍了如何使用jquery获取多行文本框的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有

<asp:TextBox runat="server" TextMode="MultiLine" id="txtHelpText" />

在网页中添加多次。

added multiple times in a web page.

想获取它的值使用jQuery -

Want to fetch its value using jquery -

$(this).find('input[id*=txtHelpText]').val();

当我删除的TextMode =多行,那么它将按预期工作,并提供价值,但不能与多行。

When I remove the TextMode="MultiLine", then it works as expected and providing value but not with Multiline.

推荐答案

当您设置的TextMode =多行,输出将是一个 textarea的,而不是输入。所以,你必须使用这样的:

When you set TextMode="MultiLine", the output will be a textarea, instead of input. So you must use this:

$(this).find('textarea[id*=txtHelpText]').val();

这篇关于如何使用jquery获取多行文本框的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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