Solved

TextArea to bullet points

Posted on 2001-06-11
8
1,402 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
  • 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
 

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
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
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 65 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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

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.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now