Mutley Posted October 3, 2006 Share Posted October 3, 2006 At the moment I input my text through a normal TEXT field in a form to the database.How can I make this a WYSIWYG editor? I've looked but it seems you have to buy everyone, I would like to learn or get source code for free. All I would want to do is Bold/Italic/Underline and colour. Quote Link to comment https://forums.phpfreaks.com/topic/22896-wysiwyg-editor/ Share on other sites More sharing options...
Ninjakreborn Posted October 3, 2006 Share Posted October 3, 2006 anything out there can be built. So build it, I would start with a text area field.Then you can try adding some stuff, like an interface to read, and perform the bold, italics functions.I would have to do a lot of thinking to come up with programming ideas bhind it, but that's all I can say, if I think of anything else I will let you nkow Quote Link to comment https://forums.phpfreaks.com/topic/22896-wysiwyg-editor/#findComment-103215 Share on other sites More sharing options...
Mutley Posted October 3, 2006 Author Share Posted October 3, 2006 Would I need to use javascript to make it visually appear when I make text bold? Quote Link to comment https://forums.phpfreaks.com/topic/22896-wysiwyg-editor/#findComment-103218 Share on other sites More sharing options...
mwmobley Posted October 3, 2006 Share Posted October 3, 2006 Take a look at tinyMCE, it might work for what you need....http://tinymce.moxiecode.com/I am currently using it but, its not w/out its own issues.....mike Quote Link to comment https://forums.phpfreaks.com/topic/22896-wysiwyg-editor/#findComment-103219 Share on other sites More sharing options...
Mutley Posted October 3, 2006 Author Share Posted October 3, 2006 [quote author=mwmobley link=topic=110395.msg446152#msg446152 date=1159897705]Take a look at tinyMCE, it might work for what you need....http://tinymce.moxiecode.com/I am currently using it but, its not w/out its own issues.....mike[/quote]Thanks but there are waaaay too many un-needed options which just slows it right down. I'll see what I can do with it though.EDIT: Nevermind, didn't see all the versions. :D Quote Link to comment https://forums.phpfreaks.com/topic/22896-wysiwyg-editor/#findComment-103224 Share on other sites More sharing options...
Barand Posted October 3, 2006 Share Posted October 3, 2006 Here's a simple sample[code]<html><head><meta name="generator" content="PhpED Version 4.5 (Build 4513)"><title>wysiwyg sample</title><SCRIPT language='javascript'> function showText(txt) { while (txt.indexOf("[")>0) txt = txt.replace("[", "<"); while (txt.indexOf("]")>0) txt = txt.replace("]", ">"); while (txt.indexOf("\n")>0) txt = txt.replace("\n", "<br>"); document.getElementById('wyg').innerHTML = txt; }</SCRIPT></head><body><FORM>Input (Use BB tags eg [b]=bold)<br/><textarea name="wysi" rows="10" cols="40" onkeyup="showText(this.value)"></textarea></FORM>Preview<DIV id='wyg' style='width:400; height: 200; border: 1px solid silver'></DIV></body></html>[/code] Quote Link to comment https://forums.phpfreaks.com/topic/22896-wysiwyg-editor/#findComment-103262 Share on other sites More sharing options...
Daniel0 Posted October 3, 2006 Share Posted October 3, 2006 I personally like TinyMCE that mwmobley suggested.I found another this directory on Google: http://www.htmlarea.com/It might help you to find one you like.An alternative is of course to code your own. Quote Link to comment https://forums.phpfreaks.com/topic/22896-wysiwyg-editor/#findComment-103273 Share on other sites More sharing options...
Mutley Posted October 3, 2006 Author Share Posted October 3, 2006 I've gone with TinyMCE, it's really impressive once you know how to alter the elements. Thanks for the code snippet Barand. Quote Link to comment https://forums.phpfreaks.com/topic/22896-wysiwyg-editor/#findComment-103303 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.