When pressing "enter" it closes </p> tag and opens new.
Is it possible to change this feature to include <br> tag without <p>?
Could not find this procedure in wysiwyg.js.
Thanks in advance.
When pressing "enter" it closes </p> tag and opens new.
Is it possible to change this feature to include <br> tag without <p>?
Could not find this procedure in wysiwyg.js.
Thanks in advance.
Please include a link to the DD script in question in your post. See this thread for the proper posting format when asking a question.
I think you're referring to the openWYSIWYG editor?
That code is pretty complex. I've changed a couple things, but it's hard to find stuff in it. I'll take a look.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Oops, sorry, of course it was about openWYSIWYG editor![]()
Meh. I dunno. That javascript is very complex.
It uses a function to write more calls to other functions on the page, at which point I'm lost.
Yeah, I'm looking through it and I can't find anything about converting to html. I don't think it's based on the event of the user hitting enter, but rather in some converting thing that the text is run though, where it converst a line break to <p>, but I still can't find it.
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Write one more function to convert <p></p> to <br> on the fly?![]()
Cause I think that that tags are included by browser in DHTML...![]()
I could write a function in php to do that easily; just not sure how to do so in JS.
All you'd need is the function to do a string replace in javascript (surely there is one), and call it onSubmit in the form tag.PHP Code:<?php
//assume $text is the final text:
$text = str_replace('<p>','<br>',$text);
$text = str_replace('</p>','',$text);
//now $text has <br> instead of <p></p>
?>
Also, in dreamweaver, if you press shift+enter, it inserts a <br> instead of <p> tag. I was thinking this script worked in the same way, so I tried it out.
But... whatever I did, I just got <br> tags... no <p> tags. I don't get it.
Now... technically, since I'm on a mac, I'm pressing return, but I don't know if that is actually different in terms of javascript. It still enters a line break, so it would be seen in the same way by the JS.
Anyway.... any ideas why we're getting different things?
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
In IE it works perfectly, on Shift+Enter it adds <BR> tag, on pure Enter it adds <P></P> tags.
Is there any way to switch the behaviour? On pure Enter - <BR>, on Shift+Enter <P>...? Or just emulate the pressed shift button...
Good question.
The issue is finding the coding, not changing it. If you find where it controls that in the JS, should be VERY easy to switch. But I can't find it...
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
Bookmarks