Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
Developer
Posts: 281
Registered: ‎05-31-2012
My Device: Playbook
My Carrier: o2
Accepted Solution

how to catch the content of a textarea with bbui and jquery

Hi, I have a problem. I build a App with bbUI and jQuery. Now I need to get the content of a Textare when someone click on the Save in the following page:

<div data-bb-type="screen" data-bb-effect="slide-left">
	<div data-bb-type="title" data-bb-caption="New" data-bb-back-caption="Cancel" data-bb-action-caption="Save" onactionclick="save();"></div>
	
	<div data-bb-type="round-panel"> 
		<div data-bb-type="panel-header">Text Entry Examples</div>
		<div data-bb-type="label-control-container">
			<div data-bb-type="row">
				<div data-bb-type="label">Text Area</div>
				<textarea id="myinput" rows="3">123</textarea>
			</div>
		</div>
	</div>
</div>

 my javascript code looks like this:

function save() {
	alert($("#myinput").text());
}

 what do i have to change to get this work? I only get the "123" but when I change it it is still "123"

Plase "+Like" my post if it was helpful.
BlackBerry Development Advisor
Posts: 761
Registered: ‎10-01-2009
My Device: All
My Carrier: N/A

Re: how to catch the content of a textarea with bbui and jquery

I believe you can just use the .val property.

 

$("#id").val()

 

Highlighted
Developer
Posts: 281
Registered: ‎05-31-2012
My Device: Playbook
My Carrier: o2

Re: how to catch the content of a textarea with bbui and jquery

This solved it Smiley Happy

Plase "+Like" my post if it was helpful.