|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
WYSIWYG line breaks
HOW DO I USE <BR> INSTEAD OF <P>?
I know about the div tags, however when i select all and press delete, it deletes the div too, and also, if its already there when you open the page, its hidden, and no code goes in there unless you type some text for them to delete. I'm looking for a way to divert all keypresses on it to a function, and let the function sort it out, however i'd need a way of sending the key to the function, aswell as sending the code that would normally be displyed for the other key's, unless i used iframe.keypress() in the code, for the other keys. so how do i divert the keypresses to a function? i use an iframe. |
|
#2
|
||||
|
||||
|
Are you referring to an article somewhere?
Or is there some code you can provide to guide us through it? Thanks.
__________________
Daryl's Homepage | My Blogroll | My Profile | Firefox supporter! DevArticles Forum Moderator "The net is a waste of time, and that's exactly what's right about it." -- William Gibson |
|
#3
|
|||
|
|||
|
Basically, i use an iFrame, when someone presses a key, instead of displaying text straight away, it needs to call a function, like this
Code:
function insertTag(tag) // this will replace any text already there
{
document.iFrame.focus();
var sel = document.iframe.document.selection;
var theFrame = sel.createRange();
theFrame.pasteHTML(tag);
}
function PressedKey(key)
{
if (key == "EnterKey") // fell free to correct me if the key code is not right
{
insertTag("<BR>")
}
if (key == "Shift&EnterKey") // I'll need the keycodes of other keys aswell, and how to do multiple keys
{
insertTag("<BR>")
}
else
{
document.iFrame.keyPress(key) // please tell me if this is correct aswell
}
}
by the way, I've tried to do this before, and not with this script, however i do not have that script anymore I use MS-IE 6 ![]() |
|
#4
|
|||
|
|||
|
I did see a property on the internet while searching, it said that there WYSIWYG editor used a property called: isNewLineBr, however when i searched for that exact phrase, the page that talked about the isNewLineBr property was the only result, MSDN didn't have it and i tried inserting it, but it didn't know what it was, if there is a property you can give to the page in your WYSIWYG editor that turns every Enter Key Keypress into a BR tag instead of a P tag please let me know =)
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > Programming Tools > WYSIWYG line breaks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|