Solved

Can an IF statement handle this textarea?

Posted on 2004-08-01
4
203 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
This article provides a convenient collection of links to Microsoft provided Security Patches for operating systems that have reached their End of Life support cycle. Included operating systems covered by this article are Windows XP,  Windows Server…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…

691 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