|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Ajax Application Generator Generate database and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
Can't get html editor to work properly
I am having some rather strange problems with the WYSIWYG editor. What I did was, split the stylesheet information to a separate file, link it in (e.g. link rel....) and split the rest of the javascript code to another file to be called in...
And in my php code, I 'required' the file with only the tables and the select boxes,........ altogether, 3 major components being called in. Everything works fine except when i try to change some text's heading, there was a javascript error saying selFont is undefined. However, the text managed to change without problems. (?).........and when i try toggling to html source code, the same error occurs. The worst part is, I can't toggle back to normal WYSIWYG mode! Everytime i try doing that, my actions added some ;gt, amp; lt; tags to the original content. I have been figuring this over the past 2 days. Please help...thank you |
|
#2
|
|||
|
|||
|
What editor are you using?
|
|
#3
|
|||
|
|||
|
Hey Tim,
If you're referring to our WYSIWYG tutorial, then it wasn't built to handle CSS/PHP. It was just to show the basics of browser-based WYSIWYG editing. There is alot of manipulation that needs to go on for this to happen. For a demo, see www.webedpro.com. They do it extremely well and might be able to give you some ideas. |
|
#4
|
|||
|
|||
|
First of all, make sure u have IE 5.5 or above, double check it, you never know? apart from that, try the article without spliting it into multiple pages, if that works, bit by bit, remove the ccs and javascript into your other files, if that causes the problems, then you have copied it wrong or something
|
|
#5
|
|||
|
|||
|
*stress out*...NOpe Ben, doesn't work even after i carefully copied them ALL in one page!And I mean really 'carefully'. Am using IE 6. Coding in VI, for your info. Another thing is, whenever i access the page that holds this editor, IE always asks me this:
This page contains both secure and nonsecure items....do you want to display the nonsecure items? Any ideas? IF i click yes, everything would be fine, otherwise, the word 'Navigation Canceled' would be in my iFrame box. I even desperately tried changing my .php file(the one that holds this editor) to html thinking it might help but to no avail....One last thing........It all just doesn't makes sense. Other editing functions are working BUT except for toggling and heading insertion...Sigh, wonder why? |
|
#6
|
|||
|
|||
|
Anyway, for the toggling and heading insertion problem, i have commented them out currently as a temporary solution until you guys can help me out....
As for the 'grabbing the html code out of iFrame' to be saved into Database, i have tried that and it worked successfully. BUT, how do i pump it back out to iFrame? I tried something like assigning the php variable to the innerText property but it doesn't work. Hope you can show me how to pump this back out because i need it for editing function thank you |
|
#7
|
|||
|
|||
|
ok, dont worry about those other 2 fucntions for the moment, im guessing by that last post you want to be able 2 edit something from a database
what you need to do is this in the iframe tag add this line src="edit.php?id=<?php echo $id; ?>" the create a edit.php which takes the id or whatever you want and graps that data from the database, and displays it just like a normal page, the only thing is you can edit that data now to your needs |
|
#8
|
|||
|
|||
|
Hi tim, how did you send the HTML to your database? I'm having problems sending the iView contents to another JSP, attempting to send it to an MSSQL database.
Any help would be great, thanks! |
|
#9
|
|||
|
|||
|
Sending it to the database for adding or editing?..... If editing, the following......
what i did was sending in an id to the src attribute of the iFrame tag. <iframe..................src="buffer.php?ID=<?=$nID?>"> In buffer.php(or whatever name you wish to choose) there will be some sql statement in it to pull out all the information to be displayed in the iFrame box. Both adding and editing uses the GrabHTML function shown by Mytch in one of his article.In the Javascript function, you grabbed the contents and assigned it a hidden value tag. THis is the name/value pair to be sent across for processing. By the way, is your toggling function working correctly? |
|
#10
|
|||
|
|||
|
Getting the value back in the IFRAME was tricky for me, but here's what I came up with. None of that SRC stuff worked, because I'm not writing out a static file. Since you're pulling from a DB, assign the dynamic value you pull down to the INPUT type-hidden variable (see other comments above, I use Cold Fusion, not PHP, so I'm no help there), then use the following line (altered to work with your naming, etc) to pull the value of that hidden form field into your IFRAME at the end of the init() funciton:
setTimeout('WYSIWYGpane.document.body.innerHTML=do cument.formname.hiddenfield.value;', 0); I don't know why this works. I thought there was some delay in loading the IFRAME body, so I used a setTimeOut with a higher number, and it worked. Then I kept lowering it to zero and it still worked... go figure. |
|
#11
|
|||
|
|||
|
Doug, is your toggling function working correctly? (please view my previous posts)
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > Programming Tools > Can't get html editor to work properly |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|