Solved

Can an IF statement handle this textarea?

Posted on 2004-08-01
4
196 Views
Last Modified: 2010-04-01
I have a form page that has a textarea field in it (example below).
Not all of the records need to have more than 20 rows for the textarea.
So on the ones that are less than 20 rows, I want to not show the scroll bar for the textarea field.  (just like my example below)
However, I do want to show the scroll bar for records with textareas larger than 20 rows.

Is it possible to write this IF statement in JSP to handle this?


<textarea style="overflow:hidden" wrap=hard cols="120" rows="20"><%= REQTEXT %></textarea>
0
Comment
Question by:g118481
  • 2
4 Comments
 
LVL 8

Assisted Solution

by:RozanaZ
RozanaZ earned 50 total points
ID: 11691261
Do you mean this:

<textarea <%if (rowsNumner <= 20){%><%="style='overflow:hidden'"%><%}%> wrap=hard cols="120" rows="20">"><%= REQTEXT %></textarea>
0
 
LVL 35

Accepted Solution

by:
TimYates earned 50 total points
ID: 11691620
or:

<textarea <% rowsNumner <= 20 ? "style='overflow:hidden'" : "" %> wrap="hard" cols="120" rows="20">"><%= REQTEXT %></textarea>
0
 
LVL 1

Author Comment

by:g118481
ID: 11693345
Both work great, so I am splitting the points.
Is this OK with you?
0
 
LVL 8

Expert Comment

by:RozanaZ
ID: 11693376
Sure, it's ok :)
Thanks
0

Featured Post

Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
method inner class 6 83
stateless EJB with glassfish 2 73
squirrelPlay java challenge 40 158
thymeleaf natural templating vs JSP 2 137
Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
The advancement in technology has been a great source of betterment and empowerment for the human race, Nevertheless, this is not to say that technology doesn’t have any problems. We are bombarded with constant distractions, whether as an overload o…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question