Misc Links
Forum Archive
News Archive
File DB
 

Ads
 

Advertisement
Age of Valor - Ultima Online Free Shard
AoS/SE/ML/Custom - advanced code, dedicated staff, peerless bosses, non overpowered customs + much much more
 

Latest Forum Topics
New PC
Posted by Wren
on Apr 27 2012, 2:58:46 pm

PSA: Ensure your forum email address is valid
Posted by MikeDB
on Apr 09 2012, 8:43:16 am

Recipe's
Posted by MikeDB
on Feb 28 2012, 12:54:29 am

My PC is now ancient
Posted by rovingcowboy
on Feb 27 2012, 8:29:26 am

Hey all
Posted by rovingcowboy
on Feb 27 2012, 8:35:12 am

 

BBcode editor: Javascript
Client Side Scripting
By Jonathan Street


Allowing visitors to post content to your website is a great way to keep those visitors coming back and a great way to attract new visitors. Forums are perhaps the best example of this with comments posted on blogs a close second. Sites like amazon even allow users to post content reviewing books. Plain text however is a little boring.

Of course it would be nice to be able to give visitors all the power of html with which to jazz up their text but there are risks with this. Whether it's malicious code designed to deface your website or a simple mistake that breaks your carefully designed page layout you want to prevent it from happening. bbCode is a simple way to give your visitors the ability to jazz up their plain text without leaving yourself open to the risks of html.

bbCode is simple to use once familiar with the syntax but can be a bit daunting at first. Because of this many sites offer an interactive text editor that takes care of all the hard work.

This is the first of a two part article looking at creating a bbCode editor. In this article I'll mainly be looking at the design of the form the user will see, the interactive text editor. In the next article I'll go through how we can process the content supplied by the user and turn it into html formatted content that can be outputted direct to your website.





Next Page
spacer
16395 Hits Pages: [1] [2] [3] [4] [5] [6] 29 Comments
spacer


Latest comments (newest first)
Posted by we_undertaker on May 05th 2008 (03:00)
i looke at http://www.iceteks.com/articles.php/javascript/1
i really like this text editor

but i dont know how to use it, cos i just new in PHP
could you please tell me how to use that with SQL , cos i want to have this text editor.

and in your html code :
<form action="bbcode.php" method="post" name="editform" onsubmit="return checkForm(this)">
i also dont know how to create bbcode.php , to run the form ...

please , please help me, i really need it
Thank you, Thank you so much

spacer
Posted by AdRock on August 08th 2007 (05:40)
I have followed the article and have noticed there are errors that I don't know how to fix.

I have used the exact code as provided in the article.

The first error I was able to fix which was a backslash in <textarea> which was missing but this is the main error.

When I type a word in the text area and I want to do some formatting such as bold or italic, th ewhole word is not highlighted with the start and end tags such as some words (supposed to be the [b] tags in there) but instead it just does some words[b].

One other question which is probably really stupid but is the second article the php file which is called when you preview what you have written?

spacer
Posted by Red Squirrel on August 08th 2007 (13:52)
Force be with you, always!
spacer
Posted by AltaGid on August 08th 2007 (14:01)
Hello! Help solve the problem.
Very often try to enter the forum, but says that the password is not correct.
Regrettably use of remembering. Give like to be?
Thank you!

spacer
Posted by sgreeny12 on April 04th 2007 (13:23)
Hey great tutorial. Really works except I have 1 question if you dont mind. I want to add an align right button similar to the one on devshed forms where the image is the classic microsoft alight right button. When I click on the bottom it automatically submits the script. Does anyone have any fixes? Thanks

I could make it into a smile but i wouldnt know how to have it give the close option. Can someone help me with that. Thanks


The first 3 work because they arnt images. The 4th which is the image doesnt work.
CODE
               <input type="button" src="images/icons/justifyleft.gif" class="button" value="left" name="left" onclick="java-script tag('left', '[left]', 'left*', '[/left]', 'left', 'left');"

onMouseOver="helpline('left')" />
               <input type="button" src="images/icons/justifycenter.gif" class="button" value="center" name="center" onclick="java-script tag('center', '[center]', 'center*',

'[/center]', 'center', 'center');" onMouseOver="helpline('center')" />
               <input type="button" src="images/icons/justifyright.gif" class="button" value="right" name="right" onclick="java-script tag('right', '[right]', 'right*', '[/right]',

'right', 'right');" onMouseOver="helpline('right')" />

               <input type="image" src="images/icons/justifyright.gif" class="button" value="right" name="right" onclick="java-script tag('right', '[right]', 'right*', '[/right]',

'right', 'right');" onMouseOver="helpline('right')" />

spacer
View all comments
Post comment

Age of Valor Ultima Online Server

Top Articles Latest Articles
- What are .bin files for? (50039 reads)
- Text searching in linux with grep (33550 reads)
- SPFDisk (Special Fdisk) Partition Manager (20930 reads)
- Creating your own content management system with php (20495 reads)
- Ultima Online Newbie Guide (19222 reads)
- How to Use MDADM Linux Raid (16136 reads)
- What is Cloud Computing? (15773 reads)
- Dynamic Forum Signatures (version 2) (16140 reads)
- Successfully Hacking your iPhone or iTouch (17299 reads)
- Ultima Online Newbie Guide (19222 reads)
corner image

This site best viewed in a W3C standard browser at 800*600 or higher
Site design by Red Squirrel | Contact
© Copyright 2012 Ryan Auclair/IceTeks, All rights reserved