Wrox Programmer Forums
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 21st, 2003, 02:05 PM
Registered User
 
Join Date: Dec 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sumi Send a message via Yahoo to sumi
Default html editor

I want to create simple html editor using javascript.
This is not a rich text editor.

All i want to do is a textarea display with syntax highlighting, find, goto line number and a word wrap option.

It must work in IE and Mozilla/firebird.

Plz anyone help me. Its urgent.



 
Old December 22nd, 2003, 12:00 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Unfortunately you won't be able to do any syntax highlighting in a simple text area. For all your other features, I'd suggest looking at the javascript used in the topic post input box on these forums. There is some pretty good javascript code that does all sorts of nifty things. This forum engine is open source, so you could download it and take a look at the source code. Of course, all the javascript is easily visible without downloading all the source.

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old December 22nd, 2003, 12:33 AM
Registered User
 
Join Date: Dec 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to sumi Send a message via Yahoo to sumi
Default

hello planoie,
thanks for replying.
but the message post input box is nothing but a rich text editor.
I know how to do it.
I need to add these features to it :
textarea display with syntax highlighting,
find,
goto line number
and a word wrap option.

plz help me if uu know how to do this.

thanking you
moushumi




 
Old December 22nd, 2003, 06:46 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

If it's urgent I suggest you buy a component. The features you ask for are fairly complicated, especially as you want it to work cross browser. If you knew dhtml well I would make a guess that this is at least a two man week development project. Parsing input and deciding whether to highlight is hard work. You would have to distinguish between:
Code:
var i = 7;
and
Code:
//var i is set to 7.
and
Code:
var i = "var i is 7";
Good luck.




--

Joe
 
Old December 22nd, 2003, 09:34 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

The post input box on this forum system is not a rich text editor. It's a standard textarea input with some very clever javascripting.

And like I said, if you want to use a textarea, you can't highlight individual lines/words.

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old December 22nd, 2003, 09:57 AM
sam sam is offline
Authorized User
 
Join Date: Jun 2003
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This may be of some help, I think it's great.
http://www.interactivetools.com/products/htmlarea/
Sam





Similar Threads
Thread Thread Starter Forum Replies Last Post
html editor MunishBhatia ASP.NET 2.0 Basics 1 February 5th, 2008 12:15 AM
Html text Editor in c#.net kanwaldeep ASP.NET 1.0 and 1.1 Basics 3 November 23rd, 2007 05:16 AM
Disappearing HTML in Editor Ron Howerton VS.NET 2002/2003 5 June 1st, 2006 06:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.