Page 1 of 1

How to change the size of TextArea?

Posted: Mon Feb 24, 2014 9:19 am
by Crystal

Hello,
I want to set the size of the TextArea to adapt to the content in the TextArea.
The code is like this :
$('textarea[dsid="mobiletextarea_44"]').css('height', 'auto');
mobiletextarea_44 is the name of TextArea.

But it does not work.So how to do?


How to change the size of TextArea?

Posted: Mon Feb 24, 2014 10:15 am
by Maryna Brodina

Hello!
Try to set Textarea height property equal to it's scrollHeight.


How to change the size of TextArea?

Posted: Tue Feb 25, 2014 12:58 am
by Crystal

But I don't know the scroll height of the textArea.The content in the textArea is different. So I want set the height to adapt to the content.


How to change the size of TextArea?

Posted: Tue Feb 25, 2014 5:01 am
by Igor

Hello,

You can use Jquery elastic plugin. Add jQuery.elastic.js file to the project and add next code to the page load event:

pre

Appery("mobiletextarea_20").elastic();

/pre

http://unwrongest.com/projects/elastic/


How to change the size of TextArea?

Posted: Wed Jun 25, 2014 9:40 pm
by Oscar

Hi,

I tried this solution but doesn't works for me.

Well, I tried so many theorycall solutions but nothing works in application, but works in Test option.

· I put overflow:auto and I've got scroll in Test but I haven't got in App.
· I applied new height using ScrollHeight and ScrollTop but doesn't works.
· I used elastic but doesn't works in Desktop Test and in App, but works in Mobile Test
I used flexibleArea (another plugin like elastic) and doesn't works in Desktop Test and in App, but works in Mobile Test.

So, can anyone give me a tested solution, please?

Thanks in advance.


How to change the size of TextArea?

Posted: Wed Jun 25, 2014 11:56 pm
by Yurii Orishchuk

Hi Oscar.

Given solution is tested and worked.

So please try this again. More details:

1 Create new Javascript and fill it with code from http://unwrongest.com/projects/elastic/

http://prntscr.com/3wizoy/direct

2 Put textarea onto the page you need. http://prntscr.com/3wj07g/direct

3 Add "page show" event handler and fill it with following code: http://prntscr.com/3wj0v3/direct

pre

//Note: you should replace "mobiletextarea_32" with your textarea name.
Apperyio("mobiletextarea_32").elastic();

/pre

Regards.