Programming Tools
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingProgramming Tools

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old December 8th, 2005, 03:04 AM
Techno-Freak Techno-Freak is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 28 Techno-Freak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 5 m 43 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old December 8th, 2005, 09:39 AM
MadCowDzz's Avatar
MadCowDzz MadCowDzz is offline
I'm Internet Famous
Dev Articles Frequenter (2500 - 2999 posts)
 
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890 MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level)MadCowDzz User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
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

Reply With Quote
  #3  
Old December 8th, 2005, 11:35 AM
Techno-Freak Techno-Freak is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 28 Techno-Freak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 5 m 43 sec
Reputation Power: 0
Thumbs up

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

Reply With Quote
  #4  
Old December 8th, 2005, 11:42 AM
Techno-Freak Techno-Freak is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 28 Techno-Freak User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 6 h 5 m 43 sec
Reputation Power: 0
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 =)

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingProgramming Tools > WYSIWYG line breaks


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT