Reputation: 119
I am having
<asp:TextBox runat="server" TextMode="MultiLine" id="txtHelpText" />
added multiple times in a web page.
Want to fetch its value using jquery -
$(this).find('input[id*=txtHelpText]').val();
When I remove the TextMode="MultiLine"
, then it works as expected and providing value but not with Multiline.
Upvotes: 0
Views: 4244
Reputation:
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();
Upvotes: 3