<%Function ListCPN()%>
<!--<textarea class="project" name="txtCPN"></textarea>-->
<TEXTAREA class="project" name="txtCPN" cols="35" rows="10"></TEXTAREA>
<%End Function%>
7 5557
karen,
this shouldn't give you any blank lines. It didn't when I tried it just now.
Jared
karen,
this shouldn't give you any blank lines. It didn't when I tried it just now.
Jared
Hi Jared,
Thanks. I would like to trim off if there is enter blank in text area so that no empty fields are shown in the table of the following page.
Users can only enter CPN line by line but cannot press enter key for new line.
Oh, I think I understand. So a user theoretically might enter a blank line which you don't want. Well, if you want to handle this with asp you could say: - dim lines, x, outputText
-
lines = split(request("myTextBox"), vbNewLine)
-
for each x in lines
-
if trim(lines(x)) <> "" then
-
outputText = outputText & lines(x) & vbNewLine
-
end if
-
next
and you are left with outputText which includes all of the original request.form("myTextBox") minus any blank lines.
Does that work for you?
Jared
Oh, I think I understand. So a user theoretically might enter a blank line which you don't want. Well, if you want to handle this with asp you could say: - dim lines, x, outputText
-
lines = split(request("myTextBox"), vbNewLine)
-
for each x in lines
-
if trim(lines(x)) <> "" then
-
outputText = outputText & lines(x) & vbNewLine
-
end if
-
next
and you are left with outputText which includes all of the original request.form("myTextBox") minus any blank lines.
Does that work for you?
Jared
Thanks. no syntax error but it doesn't work. The empty fields still showed in the tables of following page.
Why? -
<%Function ListCPN()%>
-
-
-
<TEXTAREA class="project" name="txtCPN" cols="35" rows="10"><%Call trimLines%></TEXTAREA>
-
-
-
<%End Function%>
-
-
-
<%
-
Function trimLines
-
-
dim lines, x, outputText
-
lines = split(request("txtCPN"), vbNewLine)
-
for each x in lines
-
if trim(lines(x)) <> "" then
-
outputText = outputText & lines(x) & vbNewLine
-
end if
-
next
-
-
End Function
-
-
%>
This is the code for the page where the user enters the info? It won't work there. Remember that ASP code only works WHILE the server is sending the page to the user. I had intended this code to be the code on the following page. and I think I got part of the code wrong anyway. I just tried this to make sure. the entire form was saved as "texttest.asp". The form submits to the same page, and everytime all of the blank lines are taken out and the text (minus any blank lines) is put in the textarea. - <%
-
dim lines, x, outputText
-
lines = split(request("myText"), vbNewLine)
-
for each x in lines
-
if trim(x) <> "" then
-
outputText = outputText & x & vbNewLine
-
end if
-
next %>
-
<form action="texttest.asp" method="post">
-
<textarea name="myText"><%=outputText%></textarea>
-
<input type="submit" name="submit" value="submit">
-
</form>
The enter blanks cannot be cut off and the blanks still showed in the table of following page.
I need to use Next pagelink instead of submit input.
The bold link is the link to the following page.
Dim rsEmail, qryEmail
Dim res
Dim strInput, Count
Dim lines, x, outputText
lines = split(request("txtCPN"), vbNewLine)
for each x in lines
if trim(x) <> "" then
outputText = outputText & x & vbNewLine
end if
next
<form name="frmInput" action="ApprovePartsDisplay.asp" method="post">
<tr class="filter">
<td width="120"></td>
<td></td>
<td><a onclick="javascript:document.frmInput.submit()"><f ont class="pageLink">>> Next</font></a></td>
</tr>
<%Function ListCPN()%>
<TEXTAREA class="project" name="txtCPN" cols="35" rows="10"><%=outputText%></TEXTAREA>
<%End Function%>
Karen,
I am no longer following what you are saying. What is generating the content of the textarea? If you are generating the textarea, then just don't put in blank lines. If the user is filling it out, then remove the blank lines before you save it. I don't understand which part is giving you trouble.
Jared
Sign in to post your reply or Sign up for a free account.
Similar topics
by: entoone |
last post by:
I have a form that has a text box, i.e. text area that takes 200 characters
max. When I use my update script and it brings up the information in the
database, it displays as a single line. How can...
|
by: dan glenn |
last post by:
Hi. I'm finding that if I have text entered into a
<textarea ...> </textarea> in a form, and that text
has leading blank lines (with no spaces or anything
else), that when I retrieve the entered...
|
by: Jonathan |
last post by:
I want to save textarea contents to a mysql database with the
paragraph breaks intact without having to type paragraph or break tags
in HTML. How can I do that. So far, although it occurs naturally...
|
by: Johnny Two Dogs |
last post by:
I'm strictly concerned with IE, so cross-browser compatibilty isn't
necessary. If you view the code below, I almost get exactly what I'm
looking for:
- A table of four cells that...
|
by: joelbyrd |
last post by:
Didn't know exactly where to post this, but: How do I get line breaks
in a textarea? I'm pulling text from a database, and this text
definately has line breaks in it, because I
replaced all the...
|
by: Mike Brophy |
last post by:
Here's my problem: I need to present text in a scrolling textarea such
that a checkbox is not enabled until the user has scrolled to the very
last line of the text using the vertical scrollbar.
...
|
by: ghostwalker |
last post by:
Hi
I have an HTML form with a textarea on it. When submitted (using 'get'
not 'post') this forms action php file simply does this to retrieve the
values:
$message = $_GET;
Now it all works...
|
by: Spiros Bousbouras |
last post by:
I'm thinking of adding a command to vim for removing
white space from the end of each line of a C source
file. Can anyone think of a situation where such white
space might be useful ?
|
by: lilyumestar |
last post by:
I have project I have to do for class. We have to write 4 different .java files.
Project2.java
HouseGUI.java
House.java
HouseSorting.java
I already finish House.java and I need to work on...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |