?
Solved

TextArea to bullet points

Posted on 2001-06-11
8
Medium Priority
?
1,540 Views
Last Modified: 2013-12-24
Hi folks this one is proving to be a stumper for me. I have a single text area where people can enter text.

I want to output the textarea as a unordered bullet list with a new bullet point created every time the user hits the enter key in the text area.

so if they typed

product one [enter]
Product two [enter]
product three [enter]

there would be a list with there points.

Not quite sure how to do this. I tried some code using the paragraph formate function but could not get it to work.

Any help would be greatly appreciated
0
Comment
Question by:mediatimebomb
[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
  • 4
  • 4
8 Comments
 
LVL 11

Expert Comment

by:jimmy282
ID: 6180075
simple...

<cfoutput>
#ReReplaceNoCase("#your_text_string#","#chr(10)##chr(13)#","<li>","ALL")#
</cfoutput>

Jimmy
0
 

Author Comment

by:mediatimebomb
ID: 6180119
Hi jimmy I tried your code and it does not seem to work

here is my code did I make a mistake?

form page

<html>
<body>

<form name="form1" method="post" action="formAction.cfm">
  <textarea name="textarea" cols="25" rows="5"></textarea>
  <br>
  <input type="submit" name="Submit" value="Submit">
</form>


</body>
</html>

action page

<html>
<body>

<ul>
 
<cfoutput>
#ReReplaceNoCase("#form.textArea#","#chr(10)##chr(13)#","<li>","ALL")#
</cfoutput>
 
 
</ul>


</body>
</html>

it just outputs the the text with a space in between

0
 
LVL 11

Expert Comment

by:jimmy282
ID: 6180127
try this

<cfoutput>
#ReReplaceNoCase("#form.textArea#","#chr(13)#","<li>","ALL")#
</cfoutput>
0
The Ideal Solution for Multi-Display Applications

Check out ATEN’s VS1912 12-Port DP Video Wall Media Player at InfoComm 2017. Kerri describes how easy it is to design creative video walls in asymmetric layouts and schedule detailed playlists ahead of time with its advanced scheduling feature.

 

Author Comment

by:mediatimebomb
ID: 6180152
Hi jimmy it's getting closer

the only problem is there is no bullet point in frount of the first entry and there is also an extra bullet point at the end.

I am fairly new to CF I tried this but it threw a big fat error

#ReReplaceNoCase("<li>","#form.textArea#","#chr(13)#","ALL","</li>")#

Thought it might help to put the <li> tag first and add an end </li> tag

Thanks
0
 
LVL 11

Expert Comment

by:jimmy282
ID: 6180175
actually what is happening is that this code converts all <enter>'s to <li>'s . so wherever u put a <enter>, it is converted to <li> . that is what ur question was.right?
0
 

Author Comment

by:mediatimebomb
ID: 6180200
Ya I guess it works if i manualy ad the first <li> tag before the code like this

<li>#ReReplaceNoCase("#form.textArea#","#chr(13)#","<li>","ALL")#

is it ok to not include a </li> closing tag after a list item. I see it doesn't throw an error in explorer but I wounder about other browsers?
0
 
LVL 11

Accepted Solution

by:
jimmy282 earned 260 total points
ID: 6180218
</li> is never required..dont worry

Jimmy
0
 

Author Comment

by:mediatimebomb
ID: 6180236
Thank you very much for your help.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

Question has a verified solution.

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

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
When it comes to security, close monitoring is a must. According to WhiteHat Security annual report, a substantial number of all web applications are vulnerable always. Monitis offers a new product - fully-featured Website security monitoring and pr…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Suggested Courses
Course of the Month9 days, 2 hours left to enroll

764 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