Text style editor
Posted by hoowoo
Re: Text style editor July 12, 2005 04:54AM |
Registered: 20 years ago Posts: 97 |
Hello!
Seems like I found new bug :)))) (it will be soon me profession perhaps :)))).
So if for example you use poll module on the page read.php it will not one but 2 or three forms so
document.forms[0].onsubmit = kontrola;
F = document.forms[0].".$formarea.";
document.forms[0].helpline.value
will not work.
So perhaps you have to send to javascript function form name???
Seems like I found new bug :)))) (it will be soon me profession perhaps :)))).
So if for example you use poll module on the page read.php it will not one but 2 or three forms so
document.forms[0].onsubmit = kontrola;
F = document.forms[0].".$formarea.";
document.forms[0].helpline.value
will not work.
So perhaps you have to send to javascript function form name???
Re: Text style editor July 12, 2005 05:30AM |
Registered: 19 years ago Posts: 49 |
:-)) Tx for the message.
Yes, that's right, this bug can appear.
In a beginning of the editor I used names for forms (they must be added by a webmaster into templates at their special positions). unfortunatelly original Phorum forms have not names: that means to write more commands for webmasters to activate the editor. (If you saw the phorum of my page names of forms are still left there.)
After that I wanted to make the editor simplier, the next code you write. And the editor was supposed to use without any other forms. Now I'm waiting for reactions.
Well, I didn't test the editor together with a poll module. If it puts another form before a message one, a name and modifications of the editor code would be required. (Probably with any other file of the editor.)
Or, what about to figure up all previous forms by PHP? I'll think about it.
Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]
Edited 2 time(s). Last edit at 07/12/2005 05:52AM by hoowoo.
Yes, that's right, this bug can appear.
In a beginning of the editor I used names for forms (they must be added by a webmaster into templates at their special positions). unfortunatelly original Phorum forms have not names: that means to write more commands for webmasters to activate the editor. (If you saw the phorum of my page names of forms are still left there.)
After that I wanted to make the editor simplier, the next code you write. And the editor was supposed to use without any other forms. Now I'm waiting for reactions.
Well, I didn't test the editor together with a poll module. If it puts another form before a message one, a name and modifications of the editor code would be required. (Probably with any other file of the editor.)
Or, what about to figure up all previous forms by PHP? I'll think about it.
Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]
Edited 2 time(s). Last edit at 07/12/2005 05:52AM by hoowoo.
Re: Text style editor July 12, 2005 05:35AM |
Admin Registered: 21 years ago Posts: 9,240 |
Re: Text style editor July 12, 2005 04:57PM |
Registered: 19 years ago Posts: 49 |
The bug with more forms together Avdoshyn have written about should be fixed here - well, I didn't test it with the poll or any other module. But it is tested with fictitious forms and operates well.
I do not use names of forms here, the code tests forms actions to find the right form. Isn't it complicated too?
Please, take this release as a test, if you can find any new or other bug? Waiting for mentions.
Look for the file below...
Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]
Edited 1 time(s). Last edit at 08/14/2005 06:01AM by hoowoo.
I do not use names of forms here, the code tests forms actions to find the right form. Isn't it complicated too?
Please, take this release as a test, if you can find any new or other bug? Waiting for mentions.
Look for the file below...
Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]
Edited 1 time(s). Last edit at 08/14/2005 06:01AM by hoowoo.
Re: Text style editor July 13, 2005 04:44AM |
Registered: 20 years ago Posts: 97 |
echo "for (p=0; p<formulare.length; p++) { text = formulare[p].getAttribute('action'); \n";
echo " var reg=new RegExp('post.php').test(text);\n";
echo " var regi=new RegExp('control.php').test(text);\n";
echo " var rego=new RegExp('moderation.php').test(text);\n";
poll modules send data to post.php too ^))) so it doenst' work
<div class="PhorumReadBodyText"><div class="body"><center><h2>Question?</h2><form action="post.php?5" method="post" style="display: inline;">
<table border=0><tr>
<td><input TYPE="radio" NAME="pollvote" VALUE="0"></td>
<td>Answer1</td>
</tr><tr>
<td><input TYPE="radio" NAME="pollvote" VALUE="1"></td>
<td>Answer2</td>
</tr><tr>
<td><input TYPE="radio" NAME="pollvote" VALUE="2"></td>
<td>Answer3</td>
</tr></table>
<input type="hidden" name="message_id" value="95703">
</form></center></div>
echo " var reg=new RegExp('post.php').test(text);\n";
echo " var regi=new RegExp('control.php').test(text);\n";
echo " var rego=new RegExp('moderation.php').test(text);\n";
poll modules send data to post.php too ^))) so it doenst' work
<div class="PhorumReadBodyText"><div class="body"><center><h2>Question?</h2><form action="post.php?5" method="post" style="display: inline;">
<table border=0><tr>
<td><input TYPE="radio" NAME="pollvote" VALUE="0"></td>
<td>Answer1</td>
</tr><tr>
<td><input TYPE="radio" NAME="pollvote" VALUE="1"></td>
<td>Answer2</td>
</tr><tr>
<td><input TYPE="radio" NAME="pollvote" VALUE="2"></td>
<td>Answer3</td>
</tr></table>
<input type="hidden" name="message_id" value="95703">
</form></center></div>
Re: Text style editor July 13, 2005 04:56AM |
Registered: 20 years ago Posts: 97 |
Found temporarily solution by such way
echo "function start() { var formulare = document.getElementsByTagName('form'); \n";
echo "var p = formulare.length-1; \n";
echo "F = document.forms[p].".$formarea."; XP = p; return F; return XP; };\n";
only because I know that required form is last ^))
but it works
echo "function start() { var formulare = document.getElementsByTagName('form'); \n";
echo "var p = formulare.length-1; \n";
echo "F = document.forms[p].".$formarea."; XP = p; return F; return XP; };\n";
only because I know that required form is last ^))
but it works
Re: Text style editor July 13, 2005 05:00AM |
Registered: 19 years ago Posts: 49 |
Probably I must try the poll module. If you see the loop "for (p=0; p<formulare.length; p++) ..." (and test it a little) - it returns F and XP from the last found form with action=post.php. The loop on my computer checks forms previous to the message form only no next ones. That means - where is the last form? It should be before the message form and F and XP would be right. If it is next to the message form, the F and XP are right too. I'll test it.
Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]
Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]
Re: Text style editor July 13, 2005 05:05AM |
Registered: 20 years ago Posts: 97 |
Re: Text style editor July 13, 2005 05:40AM |
Registered: 19 years ago Posts: 49 |
Probably forms names can manage all these troubles right ... ?
Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]
Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]
Post-form names July 16, 2005 05:43PM |
Registered: 19 years ago Posts: 49 |
To prevent a crash of forms if more of them is used (with other modules e.g.) you can try to use the bb-editor-enhanced-getforms.zip (see above) or this file.
Feel free to use it everywhere you want the bb-code editor run (also when the getforms one doesn't operate, even if you do not use any other module), it's a established solution to identify forms. You set names of forms manually.
I ask Phorum Devs for a name for the post-form in 5.1 as you have broached, it would come in handy here :-) Tx.
Look for the file below...
Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]
Edited 1 time(s). Last edit at 08/14/2005 06:01AM by hoowoo.
Feel free to use it everywhere you want the bb-code editor run (also when the getforms one doesn't operate, even if you do not use any other module), it's a established solution to identify forms. You set names of forms manually.
I ask Phorum Devs for a name for the post-form in 5.1 as you have broached, it would come in handy here :-) Tx.
Look for the file below...
Honza*), fórum o bylinkách a taky o křesťanském duchovním životě - [hoowoo.euweb.cz]
Edited 1 time(s). Last edit at 08/14/2005 06:01AM by hoowoo.
Sorry, only registered users may post in this forum.