Rich text box problem with browser back button using ASP

Hi,

I have developed some websites in asp in which I need to use more than one rich text boxes in a page to enter formatted text.

Now when I use RTE on the page and when I click browser back button the value in RTE shows browser page not found error and the page remain on the same page only. If I have used 10 RTE on a page then I have to click back button 10 times and each time it shows page not foud error in one by one each RTE. I think this is because RTE use frames...

Now as per my client's requirement I want that this RTE should not give error of page not found and retain the original value when one click back button.
Or I want to disable the browser back button (without opening that page on new window).

If any one can give solution to stop that error and can send page back with browser back button in one click only with more than one RTE then it will be the best solution for me...

Thank you in advance
PRIYANK
aditechinfosysAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
hujiConnect With a Mentor Commented:
There is an enhanced version of KevinRoth's RTE too. It is found at:
http://www.thirdspin.com/rte/demo.htm
http://www.thirdspin.com/rte/rte.zip        ----> For download
It has more features such as a fullscreen edit mode, etc.
Use that as a first alternative.

Huji
0
 
hujiCommented:
As I've used more than one RTE in a page, and not faced this problem, I guess this problem relates to your RTE code (which is 99% in Javascript). So I recommend you post that code here, or give a link to it, and let me see if I can do anything for you.
Another option is to change your RTE, and see if the problem persists. The RTE I most often use is the one created by Kevin Roth. I think the website was www.kevinroth.com or something like that. I'll check it out in a minute for you.
If your pages are accessible online, for me, then you can link to them, and I'll check the RTE online (so you don't need to copy and paste the HUGE code for RTE.)
Wish i can help
Huji
0
 
hujiCommented:
Yes the address was correct. The RTE demo is accessible from:
http://www.kevinroth.com/rte/demo.htm

Huji
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
aditechinfosysAuthor Commented:
ThanX Huji for your reply

I am also using kevinroth rte for the purpose... but i am facing problem with that....
My use of rte is mostly in admin section of sites... so i have created one demo page to show you... that you can check at
www.aditechinfosys.com/rte/AdminGallerytext.asp
I am using same .js file as that is in kevinroth and same way i have implemented rte in my pages...

Hope to get some positive reply for the solution of my problem

Priyank
0
 
hujiCommented:
I've created a page with a link to the page you created for me (so that I have a BACK!!) and am with the issue. I'll post the results soon.
Huji
0
 
hujiCommented:
Hi
1) With Firefox, I don't face your problem. Pressing the BACK button works correctly there.
2) With Internet Explorer I get the error message.
Solution:
1) I'm working on the issue, and check if I can solve it. I recommend you to download and use the LATEST version of Kevin's RTE if you are using an older version. Meanwhile I'll do my best to solve it for you, and paste the results here for you.
2) www.KevinRoth.com  also has a forum which is free for registration. There, kevin and others regularly answer to such questions. So you can benefit from its advantages as well.
Wish I can help
Huji
0
 
hujiCommented:
Funny! I've never noticed that bug!
It only happens with Internet Explorer. I've searched in Kevin Roth's forum, and found this:
http://www.kevinroth.com/forums/viewtopic.php?t=300

And I think applying these items:

http://www.kevinroth.com/forums/viewtopic.php?t=300&postdays=0&postorder=asc&&start=10

or these:
http://www.kevinroth.com/forums/viewtopic.php?t=300#883
http://www.kevinroth.com/forums/viewtopic.php?t=300#886
http://www.kevinroth.com/forums/viewtopic.php?t=300#943


can help you.
For now, all I have to add is, it doesn't matter weather you have ONE or more RTE in your page. It just HAPPENS!

Wish I can help
Huji
0
 
hujiCommented:
PS: As Kevin has reported, he has fixed the CRASH but not the MULTIPLE BACKs issue in his latest version.
0
 
aditechinfosysAuthor Commented:
Is there any other way using javascript or other script we can just disable or hide the standard button like back button. I want to disable this button on those pages where there is RTE.

This solution will also help me...
0
 
hujiCommented:
Well, honestly not. Even if you open a new window, which doesn't have the standard bottons (including back botton) shown above there, the user is still able to RIGHT CLICK on the page and choose back!!
As such a feature (disabling back button) could be used as a harmful tool by baddies, this is not including in any web language.
Wish I can help
huji
0
 
aditechinfosysAuthor Commented:
Can I use other richtextbox,So I have to not made more change in my code & Solve out Above problem also
0
 
hujiCommented:
Of course. I'll send a series of links to RTEs within a day for you. (I'm not at home right now.)
Wish I can help
huji
0
 
aditechinfosysAuthor Commented:
Ok Huji,Please Help me.I'm waiting 4 that.If Possible then Give me small example of that  RTEs So I can Update my code very fast.Thanks 4 reply
0
 
hujiCommented:
Oops. Excuse me for the delay. I created a list of them, but forgot to send them here.  *-(


List of RTEs  - List of Rich Text Editors

http://aplosmedia.com/products/rteeditor
http://www.conceptuel.co.uk/conceptRTE/
http://www.fckeditor.net/
http://www.htmlarea.com/
http://richtext.sourceforge.net/
http://dhost.info/frenezia/


Wish I can help
Huji
0
 
hujiCommented:
Notes:
1) I've noticed that my first link is no more working. Seems that aplosmedia web site doesn't show its RTE in the product list too. Perhaps they don't like it any more!
2) Almost all the above links have a Demo. Almost all of them work good with IE 5 and above, Firefox, and many other browsers. Almost none of them work with Opera.
3) I'm adding two more links here:

http://tinymce.moxiecode.com/
http://www.webwizguide.info/asp/sample_scripts/RTE_application.asp

4) Some of the above are very excellent coded, but are very complex. I dare not to modify some of them. I dare not to use some even!! ;o)
5) The only RTE that I've gone through its source code and understood it almost completely is the KevinRTE. I may be unable to help you with some of the others. However, some like what WebWizguide offers, are unlikely to have bugs.
6) All of the above are Free tools. It is a good habbit to give them rates from within their web sites (if there is such an option) after using them. It is even an excellent idea to write reviews about them, to let other know how you found them.

Huji
0
 
aditechinfosysAuthor Commented:
OK Huji Thanks 4 Reply.Now  I will change my code,If code is working then I will give point  to u.
0
 
hujiCommented:
Meanwhile, I'll try to find a way to fix KevinRTE itself.
huji
0
 
aditechinfosysAuthor Commented:
Hi Huji,I think I'm getting some better solution then past, Thanks for that.But I want to Proper solution from ur side.I think U will help me.I'm using ur Rte demo.But using that I can get blank page insted of Error page.Thats good 4 me.But I want Back Page means last page.If u will do that then tell me.If u will not do then also tell me.So I will give point to u.Thanks 4 help
Patel Pradip R
0
 
hujiCommented:
Hi
I'm a bit busy for now, but I try to have a deep look to the case in the weekend. I firstly thought that problem is caused by a bug in Internet Explorer (since it doesn't happen in FireFox.) However, later I noticed that other RTEs are not facing a same problem. To me it has one meaning:
We have to read the code of those other RTEs and try to implement Kevin's RTE with a same system, which prevents IE to go mad!
If you really want to close this question, you can accept an answer now. However, I'll post any news to you here (even after the question is closed.)
Wish I can help
Huji
0
 
hujiCommented:
It would be an appreciable if you tell me which RTE are you using now (I mean which RTE did work for you without error or problem with Back button.)
Huji
0
 
aditechinfosysAuthor Commented:
Yes,I think U r Right,Give me a link of another RTE,Which can not face this type of Problem.After ur Comment I want to closed this questions,& Giving Point to u.If u want to open this questions then also tell me. I think that if u find better soln then After closed this question then give me answer as a commnet.
0
 
hujiCommented:
I've given a lot of links to you! You can use any of those RTEs. For now, I think you can close this question.
I will have a look into a fix for Kevin's RTE. If I could fix it, then I'll post the fix here for you as a comment.
Huji
0
 
aditechinfosysAuthor Commented:
Ok Huji..Thanks 4 help.

http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_21372718.html

If u click on this Link,U can find my another questions.Of course I found solution but thats not much better.Ya Questions has no much more points But I think u can help me.Best Lucj 4 Future

Patel Pradip R
0
 
hujiCommented:
Hi
I've noticed that ConceptRTE (http://www.conceptuel.co.uk/conceptRTE/) which is more or less a KevinRTE-based system, doesn't face the back button problem. It has many things shared with KevinRTE, such as the writeRichText method. So you can easily shift to it.
Hope it helps
huji
0
 
aditechinfosysAuthor Commented:
Hi Huji..I'm ty this  one,I think previous one is better.Beacuse we need that type of editor in which we can see code view...Thanks 4 reply

Patel Pradip R
0
 
hujiCommented:
You can implement Kevin's to be like this one, or you can implement this one to have the view source option just as Kevin's does. I'll be creating a little web site with such an RTE in near future, which means I'll fix the codes. Afterwards, I'll post them here to you as well.
huji
0
 
hujiCommented:
Hi there!
I'm here with a real solution:

1) Go and download ConceptRTE from this URL:
http://www.conceptuel.co.uk/conceptRTE/
2) Modify your pages to use this RTE.
3) Go to conceptRTE.js file and make the following modifications:
   A) Go to the end of writeRTE function, where it says enableDesingMode(rte, html, readOnly); Add this line two lines ABOVE this line, which will be just above the line with the LAST document.writeln :

      if (!readOnly) document.writeln('<br /><input type="checkbox" id="chkSrc' + rte + '" onclick="toggleHTMLSrc(\'' + rte + '\');" />&nbsp;View Source');

   B) Now go the end of the conceptRTE.js file and add this function there:

function toggleHTMLSrc(rte) {
      //contributed by Bob Hutzel (thanks Bob!)
      var oRTE;
      if (document.all) {
            oRTE = frames[rte].document;
      } else {
            oRTE = document.getElementById(rte).contentWindow.document;
      }

      if (document.getElementById("chkSrc" + rte).checked) {
            document.getElementById("Buttons1_" + rte).style.visibility = "hidden";
            document.getElementById("Buttons2_" + rte).style.visibility = "hidden";
            if (document.all) {
                  oRTE.body.innerText = oRTE.body.innerHTML;
            } else {
                  var htmlSrc = oRTE.createTextNode(oRTE.body.innerHTML);
                  oRTE.body.innerHTML = "";
                  oRTE.body.appendChild(htmlSrc);
            }
      } else {
            document.getElementById("Buttons1_" + rte).style.visibility = "visible";
            document.getElementById("Buttons2_" + rte).style.visibility = "visible";
            if (document.all) {
                  //fix for IE
                  var output = escape(oRTE.body.innerText);
                  output = output.replace("%3CP%3E%0D%0A%3CHR%3E", "%3CHR%3E");
                  output = output.replace("%3CHR%3E%0D%0A%3C/P%3E", "%3CHR%3E");
                  
                  oRTE.body.innerHTML = unescape(output);
            } else {
                  var htmlSrc = oRTE.body.ownerDocument.createRange();
                  htmlSrc.selectNodeContents(oRTE.body);
                  oRTE.body.innerHTML = htmlSrc.toString();
            }
      }
}



4) Test the whole thing and ensure it works correctly both in Internet Explorer and in Firefox.

Hope it helps
huji
PS:Please inform me if it worked for you correctly.
0
 
aditechinfosysAuthor Commented:
Ok Huji,Now a days I'm so Busy,So When I will inplement at that time I will tell u
0
 
hujiCommented:
I'll be waiting for it. However, I did the same and it worked for me fully.
Huji
0
 
aditechinfosysAuthor Commented:
Ok Huji U have to see My third Questions Here.Its About Pdf File.

http://www.experts-exchange.com/Web/Q_21390268.html
0
 
aditechinfosysAuthor Commented:
Wait a week..Still Busy
0
 
hujiCommented:
No problem. This question is closed, so I can wait forever! ;o) *L*
Huji
0
All Courses

From novice to tech pro — start learning today.