how to set textarea number of rows in javascript?

Post any questions you have about using the Verj.io Studio, including client and server-side programming with Javascript or FPL, and integration with databases, web services etc.

Moderators: Jon, Steve, Ian, Dave

xren
Ebase User
Posts: 272
Joined: Fri Dec 14, 2012 2:55 pm
Location: Ottawa

how to set textarea number of rows in javascript?

#1

Postby xren » Tue Apr 08, 2014 1:55 pm

Hi,

I have field map to a textarea control.

I have the max length of the field is 1024 bytes.
and the number of rows of this text area set to 3 and cannot be more than that due to page layout.

When I type in more than 3 line, the textarea become scrollable. That is good.

However, I want to print this page. The print layout only display 3 lines.

So, how can I reset the number of rows of this textarea to the actual number of lines of the content before print it?

Thanks,
Xiaoli
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#2

Postby Jon » Wed Apr 09, 2014 7:45 am

Are you generating a PDF? If so, the simplest solution is to make the textarea display only, or use the report option with form.generatePdf() which makes all fields display only. Then the textarea should take up enough space to accommodate the text content.

Here's the doc: http://dev-docs.verj.io/ufs/doc/Printin ... c369529428

Doing this any other way is quite difficult; you can't change the number of rows dynamically other than by using Javascript on the client. If you search online, you will see quite a few exotic solutions for auto-sizing textareas.
0 x

xren
Ebase User
Posts: 272
Joined: Fri Dec 14, 2012 2:55 pm
Location: Ottawa

#3

Postby xren » Wed Apr 09, 2014 5:59 pm

Thank you Jon.

That is exactly what I would like to do.

Do you know a resource about how to design printing multiple pages for one form (single page in the form designer). and all have same header and footer?

Thanks again.
0 x

Jon
Moderator
Moderator
Posts: 1342
Joined: Wed Sep 12, 2007 12:49 pm

#4

Postby Jon » Thu Apr 10, 2014 7:17 am

Follow the documentation link above, then go to the top of the document and see the sections "Headers and Footers" and "Adding Page Breaks".
0 x


Who is online

Users browsing this forum: No registered users and 20 guests