473,327 Members | 1,952 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

UBB-Style tags with IE and Mozilla

Hey,

i got a code-snippet to insert around a selected text
in a textarea html-form inputfield.
This code works fine with IE, but with Opera / Mozilla / Konqueror
just nothing happens.

Here is the code snippet:

var seltext = null;
var repltext = null;
function InsertTag(strOpen,strClose)
{
seltext = (document.all)?
document.selection.createRange() : document.getSelection();
var selit = (document.all)?
document.selection.createRange().text : document.getSelection();
if (selit.length>=1)
{
if (seltext)
{
repltext= strOpen + selit + strClose;
if ((repltext=='')||(repltext==null)) repltext=seltext.text;
seltext.text = repltext;
window.focus()
}
}
else
{
alert(document.frmTest.strHTML.caretPos)
}
}
And then in the html-form:
<input type="button" value="B" onclick="javascript:InsertTag('', '');">
As i said, IE works fine. Mozilla won't :(
Thx for any help in advance
Jul 23 '05 #1
1 1133


Jörg Dembski wrote:

i got a code-snippet to insert around a selected text
in a textarea html-form inputfield.
This code works fine with IE, but with Opera / Mozilla / Konqueror
just nothing happens. As i said, IE works fine. Mozilla won't :(


You are not using the right API for Mozilla, for Mozilla 1.3 and later
there is an API, see
http://www.faqts.com/knowledge_base/.../13562/fid/130

--

Martin Honnen
http://JavaScript.FAQTs.com/

Jul 23 '05 #2

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

Similar topics

1
by: Market Mutant | last post by:
I don't care about money. I want the best board: low CPU/memory take. Low MySQl usage. I have heard that PHPBB is the worst if you know PHP and read the codes. So I pass on that one. Can...
2
by: gilgantic | last post by:
How do you deal with floating points in J2ME? From my understanding MIDP 1.0 does not allow you to use float or double primitives. I want to be able to perform a calculations which give float or...
0
by: Mukesh Kumar | last post by:
Dear friends, I am very new to this forum. Please pardon me if this question has been posted before. I am looking for some Bulletin Board software like UBB, YaBB etc. I know Java but haven't...
5
by: clusardi2k | last post by:
Hello, I have a assignment just thrown onto my desk. What is the easiest way to solve it? Below is a brief description of the task. There are multible programs which use the same library...
2
by: galleywench | last post by:
Greetings, My brother in law is looking to improve his advise website regarding stocks. He needs: 1) to accept credit cards for subscribers. 2) post charts
3
by: Brian Tkatch | last post by:
I'm trying to get more information on connect via .NET to UDB. On <URL:http://www-128.ibm.com/developerworks/db2/zones/vstudio/> there is a link "CBT: Fast path to DB2 UDB in a Visual Basic .NET...
4
by: u0key.Lee | last post by:
Recently , i make my own ASP pages, but i have a problem with "UBB Code" , i want to know how to include "UBB Code" in my own ASP programme ? Anyone who know this , please help me. Thank you
5
by: esscher | last post by:
I am a ajax newbie so be kind please! I'm not sure if my title made sense, but I'll try to be clear about my question. Why does the javascript that is in the page that I have requested from...
1
raveendrabikkina
by: raveendrabikkina | last post by:
Hey folks..!!! I have basic knowledge in core java and I'm going to write scjp5 exam with in 5 months can any one sujjest me the best way to pepare for it. and please also give some useful links...
1
by: vijayann | last post by:
i am preparing scjp exam any one give me some tips how to prepare that exam and suggest any book for that exam
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.