• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 296
  • Last Modified:

HTML - Text area

Have an issue with posting/preview posting threads.
Users would enter data in any format in the thread and we were suppose to retrieve the data in the same way, something similar to here.. the way i'm typing.

If users adds line breaks or carriage returns then does the post, i'm able to handle that and show the same way but if user has entered continuously without a break something like below..  i'm not able to break the way text area does it.

--See alphabets along with numbers part break up meaning i'm able to show them the way user entered the data but those below numbers entered continuously i can't break that up the same way..
abcde 11111 abcde 22222 abcde 33333 abcde 44444 abcde 55555
abcde 11111 abcde 22222 abcde 33333 abcde 44444 abcde 55555
abcde 11111 abcde 22222 abcde 33333 abcde 44444 abcde 55555
abcde 11111 abcde 22222 abcde 33333 abcde 44444 abcde 55555
abcde 11111 abcde 22222 abcde 33333 abcde 44444 abcde 55555
abcde 11111 abcde 22222 abcde 33333 abcde 44444 abcde 55555
abcde 11111 abcde 22222 abcde 33333 abcde 44444 abcde 55555

--see below how the text area breaks it up
-- i can't do the same when i post or preview
this happens because its a text area but i cant seem to do it on the page.
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222223333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333
Let me know how would i do break it on page on when i post and retrieve the text back to page. Remember something users can put carriage returns or breaks at the end.. so i have this code attached for that but code doesn't work continuous data entry process.
Let me know if you have questions.

Thanks!
Function LineBreak(strDisplay)
    strDisplay = Replace (strDisplay, "<br />", vbcrlf)
    LineBreak = strDisplay
End Function
<!--would call this function on the display in <td tag> -->
.Write "<td class='background'><small>" & LineBreak(strPostDescription) & "</small><br />"
<!--but this doesn't work for continuous data entry.-->

Open in new window

0
onebite2
Asked:
onebite2
  • 10
  • 6
1 Solution
 
Paul JacksonCommented:
Set the wrap attribute to hard on the textarea :
<textarea cols="20" rows="5" wrap="hard">
0
 
HainKurtSr. System AnalystCommented:
maybe you need this

Function LineBreak(strDisplay)
    strDisplay = Replace (strDisplay, vbcrlf, "<br />") ' you out the parameterse in reverse order
    LineBreak = strDisplay
End Function
0
 
onebite2Author Commented:
HainKurt, It adds dash at the end. Any idea
It does break it fine but adds dashes at the end. I'm sure its not from my code.
abcde 11111 abcde 22222 abcde 33333 abcde 44444 abcde 55555
abcde 11111 abcde 22222 abcde 33333 abcde 44444 abcde 55555
abcde 11111 abcde 22222 abcde 33333 abcde 44444 abcde 55555
abcde 11111 abcde 22222 abcde 33333 abcde 44444 abcde 55555
abcde 11111 abcde 22222 abcde 33333 abcde 44444 abcde 55555
abcde 11111 abcde 22222 abcde 33333 abcde 44444 abcde 55555
abcde 11111 abcde 22222 abcde 33333 abcde 44444 abcde 55555

--It does break it fine but adds dashes at the end. I'm sure its not from my code.
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 - 0111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111 - 1222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222 - 2333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 - 3

Any thoughts
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
onebite2Author Commented:
Looks like browser does it but not sure.. It's def. not in my code.
When user enters flowing text on text area, save and retrieve the data shows soft hyphen or "-" at the end of flowing text.
Just like this
000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111 - 233333333333333333333333333333333332222222222222222 - 2333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333 - 3

But when i post the data, there isn't any dashes or hyphens, i even looked at the database.
000000000000000000000000000000000000000000000000000000000000000000000000000001111111111111111111111111111111111111111111111111111111111111111111111111111111111111333333333333333333333333333333333322222222222222223333333333333333333333333333333333333333333333333333333333333333333333333333

Any thoughts
0
 
HainKurtSr. System AnalystCommented:
use this

<textarea style="scroll:auto;width:600px;border:1px solid gray;" rows=7 readonly>
000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111122222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222223333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333
</textarea>

if you need add more style to make it like a div :)
0
 
onebite2Author Commented:
I would give it try but i don't think it has to do anything with text area.
After the post the message, we display the message on screen on browser i mean.
Message is been displayed on browser page.
That's the i said browser doing this maybe.
0
 
HainKurtSr. System AnalystCommented:
whats your latest code that gives - ? also did you check the source of the page on browser? right click, view source... what do you see there, copy and paste here...
0
 
onebite2Author Commented:
It still shows hyphen at the end of the line.
Again looks like hyphens are being forced by browser to break continuous flowing text .
Not sure why this is happening and how to prevent hyphens at the end.
 
0
 
HainKurtSr. System AnalystCommented:
please post the rendered html, so we can see on our browsers...
0
 
onebite2Author Commented:
0
 
onebite2Author Commented:
Let me know if you need anything
0
 
onebite2Author Commented:
0
 
HainKurtSr. System AnalystCommented:
if this is the case, some code is adding those -

nothing to do with browsers... what is your code (that produces this, not the first post, the one you are using right now) to create this? I mean this part

<td class='background'><small>....</small><br /></td>
0
 
HainKurtSr. System AnalystCommented:
in your very first post, you said you are using this:

.Write "<td class='background'><small>" & LineBreak(strPostDescription) & "</small><br />"

this does not produce the html you posted if you already checked the db and there is no - inside...
The function is not responsible for this... then how do you get data from your db and put into strPostDescription? you never mentioned this and the problem is there I guess... post the code for getting data from db, and storing it into strPostDescription and all steps if you do with strPostDescription...
0
 
onebite2Author Commented:
There are no hyphens or dashes if i use this
.Write "<td class='background'><small>" & strPostDescription & "MR" & "</small><br />"

but when i use the function and do below, i find hyphens or dashes
.Write "<td class='background'><small>" & LineBreak(strPostDescription) & "</small><br />"

Here is the function
Function LineBreak(strDisplay)
    strDisplay = Replace (strDisplay, vbcrlf, "<br />")
    LineBreak = strDisplay
End Function
0
 
onebite2Author Commented:
There are no hyphens or dashes if i use this
.Write "<td class='background'><small>" & strPostDescription & "</small><br />"

but when i use the function and do below, i find hyphens or dashes
.Write "<td class='background'><small>" & LineBreak(strPostDescription) & "</small><br />"

Here is the function
Function LineBreak(strDisplay)
    strDisplay = Replace (strDisplay, vbcrlf, "<br />")
    LineBreak = strDisplay
End Function
0
 
onebite2Author Commented:
Found the issue.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 10
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now