[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

TextArea to bullet points

Posted on 2001-06-11
8
Medium Priority
?
1,579 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
Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

 

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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

Article by: kevp75
Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

656 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