?
Solved

Can an IF statement handle this textarea?

Posted on 2004-08-01
4
Medium Priority
?
206 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 200 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 200 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
The Summer 2017 Scholarship Winners have been announced!
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses
Course of the Month13 days, 18 hours left to enroll

801 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