473,790 Members | 3,200 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Textarea HTML editor compatible with Opera

Hi folks,

I am desperatly looking for a WYSIWYG HTML editor for a textarea, using JavaScript and that'll work
with Opera.
I want this editor to use for a webmail program in PHP, and allow users to send HTML email.
All HTML editors I found out on the web work for most browsers except Opera.
Does any of you guys know of an Opera-friendly editor?
That would be great...
Thanks,

--
Charles.
Jul 20 '05 #1
2 5228
Charles wrote:
I am desperatly looking for a WYSIWYG HTML editor for a textarea, using JavaScript and that'll work
with Opera.
Generally, two techniques can be used to design such editors:
- "design mode" model,
- selection/transformation model, using text ranges.

AFAIK, only IE supports these two methods (although Mozilla may have
included some, I'm late in my browser testing), so unfortunately I don't
think you'll find the kind of editor you're looking for working on Opera.
I want this editor to use for a webmail program in PHP, and allow users to send HTML email.


Well, you could let them write custom-HTML and offer them a preview area
(Opera 7+ does support innerHTML and DOM methods) eg something like
(slightly tested only, but you see the point):
<form action="foo" onsubmit="retur n false">
<textarea name="editArea" ></textarea>
<input type="button"
onclick="p(this .form.elements['editArea'].value);"
value="Preview" >
</form>

<div id="previewArea "></div>

<script type="text/javascript">
function p(s){
// we only accept B, I, A tags
// a tag is defined as [T]content[/T]
// or [A href="foo"]content[/A]
var re = /\[([abi])(\s+href="[^"]+")?\](.*?)\[\/\1\]/ig;
s=s.replace(/</g,"&lt;").repla ce(/>/g,"&gt;");
s=s.replace(re, function(a, b, c, d) {
c = c || "";
if (d) d = d.replace(re, arguments.calle e);
return "<" + b + c + ">" + d +"<\/" + b + ">";
});
document.getEle mentById("previ ewArea").innerH TML=s;
}
</script>
Good luck,
Yep.

Jul 20 '05 #2
Thanks ;-)

--
Charles.
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
9364
by: Hal Halloway | last post by:
I want a text editor inside a form's textarea, So I would see html markup and html entities - just like a text editor. I also would want to be able to edit it all just like a text editor - this is done in PHPMyadmin for example...is there an easy way to do this? In a way i'm asking the browser to suspend rendering markup.
4
16725
by: Csaba Gabor | last post by:
What I'd like to do is to be able to set the font of a textarea element to the same font that another element is using (say, for example, an <INPUT type=text ...> element, but if that's a no go, then a generic element's font will do OK, too. What's the correct way to do this, please (so that it will also work for IE 6)? The motivation for this is that I have some text on the screen and I want to insert a textarea element between the...
2
11237
by: Mark Szlazak | last post by:
The following code fails in Firefox to get at selected text in the right-side textarea. Any help would be appreciated. <html> <head> <script> var agt = navigator.userAgent.toLowerCase(); var safari = ((agt.indexOf('safari') != -1) && (agt.indexOf('mac') != -1))? true:false; var opera = (window.opera)? true:false;
1
5701
by: Nic | last post by:
Hi - I am battling to find the a resource, so maybe some one in here can help The problem is as follows: I am trying to build a mod_perl source code editor for the web - to edit Perl source code in a browser. The trick is that I want to add syntax highlighting to a HTML TEXTAREA tag. There are millions of resources for just normal text color and background colors (and images), but nothing on keyword highlighting.
3
6777
by: Fluffy Convict | last post by:
I am trying to write a script that changes a textarea wrap realtime, basically like you can switch to and from "wordwrap" in Microsofts Notepad. Because of a bug (https://bugzilla.mozilla.org/show_bug.cgi?id=302710), FireFox does not listen to the textarea.wrap = 'soft' command. Because I want the script to be cross-browser compatible, someone suggested to remove and immediately add a node to the DOM, so I now have: ...
5
4584
by: bwucke | last post by:
Is there any way to scroll textarea (to the bottom row) from Javascript in Opera? The textarea.scrollTop=textarea.scrollHeight+textarea.scrollTop; approach doesn't work, and there's so many notices that it doesn't all over the net, that if there's any solution/workaround to this problem on the net, it's unfindable. Alternatively (my workaround) is there any way to reliably count lines
0
6438
by: lawrenceS59 | last post by:
Hi all, I'm fairly new to web development so bare with me. The html page that i've created isn't working and i can't figure out why. I'm guessing there are some rules that need to be followed when putting xml between the <textarea></textarea> tags. The textarea and the submit buttons are located inside <form> tags. When a button is pressed it calls a jsp page to do the processing needed. For some xml content it works nicely....for others i...
3
2701
kendall
by: kendall | last post by:
I'm currently working on a PHP CMS for my school that uses simple forms to update the pages and database. To get it out in use, it will have to be usable by people who don't know that is bold, and all the rest of it. I have noticed that vBulletin has the best formatting buttons (and no, I'm not talking about the WYSIWYG editor, I know that's way beyond me) so I was thinking of something similar (if I get bold, italic and underlined working, I'm...
2
3806
by: olddocks | last post by:
i am planning on kind of editor by replacing the textarea with iframe so that i could edit the content with rich html. I am facing weird problem and i cannot set the value of iframe innerHTML with the value of textarea while loading. The idea is hide the textarea after moving the value to iframe rich text editor. what could be the problem. here is the code var myeditor;
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10419
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10201
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6770
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5424
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5552
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4100
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3709
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2910
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.