user2324497
user2324497

Reputation: 119

How to fetch Multiline textbox value using jquery

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

Answers (1)

user1823761
user1823761

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

Related Questions