Topic "Forum JavaScript broken - with Fix"

Author Message
Guest




Inserting emoticons and bold/italic/.. does not work here in IE6 and FireFox. I checked the source and found that you have to change the name of the input-textarea:

Old:
... textarea name="zprava3" ...

New:
... textarea name="message" ...

Then the JavaScript works again fine. Thanks for all your effort on this very good project! I contribute this fix to it.
Advertisements
Guest




Oops, just found that you have some kind of an anti-spam code in your php that uses different textarea, so here is a more advanced fix:

Locate the places in source and add/do these changes in the script

...

<div id="pagebody">
<script language="JavaScript" type="text/javascript">
<!--
var current_message = null;
window.onload = function () {
if ((document.post.zprava1.style)&&(document.post.zprava1.style.display!="none")) {
current_message=document.post.zprava1;
} else if ((document.post.zprava2.style)&&(document.post.zprava2.style.display!="none")) {
current_message=document.post.zprava2;
} else if ((document.post.zprava3.style)&&(document.post.zprava3.style.display!="none")) {
current_message=document.post.zprava3;
} else if ((document.post.zprava4.style)&&(document.post.zprava4.style.display!="none")) {
current_message=document.post.zprava4;
} else if ((document.post.zprava5.style)&&(document.post.zprava5.style.display!="none")) {
current_message=document.post.zprava5;
}
}

// bbCode control by
// subBlue design

...

function checkForm() {

formErrors = false;

if (current_message.value.length < 2) {
//
if (document.post.message.value.length < 2) {
formErrors = "You must enter a message when posting.";
}

...

function emoticon(text) {
var txtarea = current_message; //document.post.message;

...

function bbfontstyle(bbopen, bbclose) {
var txtarea = current_message; //document.post.message;

...

function bbstyle(bbnumber) {
var txtarea = current_message; //document.post.message;
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
Thanks! I've applied your fix. I haven't noticed the bug so far, as I do not use buttons Sad
_________________
Martin Prikryl
Guest




Very Happy Smile Cool Laughing Razz Wink Mr. Green

Works flawless now!

Now if only there would be also old-style FTP in WinSCP, I already read + "signed" the petition for that in other thread... Wink

Great work, WinSCP is the best piece of software I have seen so far on Windows.
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License