|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
WYSIWYG Editor help!
hello,
I've put together a wysiwyg editor, using some of the code from an artical on this site ( http://www.devarticles.com/content....cleId=90&page=1 ) and some code from another artical, everything works great in the editor, and only problem I'm having is writing the content from the editor to a db, now my script to write to the db is fine, but I can't get the info to the script, like I tryed name the Iframe and using a request.form, but I get no info that way,, can any one please explain to me what I'm doing wrong and how to fix this? thanks in advance for your time! |
|
#2
|
|||
|
|||
|
Are you having trouble with saving the data to your database, or from retrieving the info and then displaying it in your source frame?
If you're having trouble retrieving the data, try this thread for some help: http://www.devarticles.com/forum/sh...s=&threadid=415
__________________
____________________________________________ Developer Shed Weekly Writer | DevArticles Forum Moderator Build Your Own KlipFolio Klip With PHP FrankManno.com - Under Construction Design Interactive Group - Under Construction |
|
#3
|
|||
|
|||
|
I'm having trouble getting the data from the iframe, I read something about using java get to the data, but I'm not sure how to do it,
|
|
#4
|
|||
|
|||
|
Hi,
I had the same problem, but got the solution from various message boards... here is what I did: In the function Init() section add this: function savedocument() { htmtext=iView.document.body.innerHTML; iView.document.body.innerText=htmtext; document.saveform.content.value=iView.document.bod y.innerText; } where saveform is the name of the form you are using... if you're not using a form...before you output the table to display the buttons of the WYSIWYG part.. add this: (right after the <body onLoad="Init()"> part...... <form action="add_to_DB.asp" name="saveform" method="post" onSubmit="savedocument()"> <input type="hidden" name="content"> |
|
#5
|
|||
|
|||
|
sorry...I pressed enter and submitted before I finished!!
ok, so after the last bit, comes your buttons and frame etc etc.... at the end of the page... before the </body></html> bit, add this: <input name="Submit" type="submit" value="Submit"> </form> then that completes the form. Basically what is happening is that when you submit the form, the contents of the iFrame is being turned in to HTML and placed in to the <hidden> form tag in the page... this is then being submitted in to the database using "add_to_DB.asp" Hope this helps! |
|
#6
|
|||
|
|||
|
hmm, that didn't work for me,,
could I maybe see your code? my code is too big to put into this forum, max allowed is 10000 characters. |
|
#7
|
|||
|
|||
|
sure, no problem.... send me your email address and I'll post it over... I think you can send me a PM and I'll get it that way..?
|
|
#8
|
|||
|
|||
|
well I tried pming you my code and still it will not allow that many characters.
my email address is angst@industrialradio.net thanks for all your help! ![]() |
|
#9
|
|||
|
|||
|
I have sent you the code now..
Hope it's ok! |
|
#10
|
|||
|
|||
|
one more thing,
whats the name of the input,,? like when using: request.form (" what name should I use ") to get the info to my db,,? |
|
#11
|
|||
|
|||
|
I used "content" as the hidden variable to store the value of the iFrame in. then to get it in to the DB I used
rsRecordset.AddNew rsRecordset.BodyofiFrame = request.form("content") rsRecordset.Update where "content" is the name of the populated hidden field in the WYSIWYG editor page.... |
|
#12
|
|||
|
|||
|
ok, now I'm getting a strange error while submitting it,
Microsoft OLE DB Provider for ODBC Drivers error '80040e21' Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done. /edit/submit.asp, line 17 ------------------------------------ here's my code: <% dim data, content data = request.form("content") dim rs set rs = Server.CreateObject("ADODB.RecordSet") rs.cursorlocation = adUseServer rs.CursorType = adOpenKeySet rs.LockType = adLockOptimistic rs.open "news",myconn, , ,adCmdTable rs.addnew rs("message") = data rs("date") = date() RS.update rs.close set rs = nothing %> any ideas? |
|
#13
|
|||
|
|||
|
I really don't know! Sorry!
the error appears to be when you are trying to submit the data... try commenting out all the update and add new commands and try simply outputting the value of "content" to see if the info is actually being sent correctly... <% data = request.form("content") response.write "Here is the info<BR><BR>" & _ "<P>" & data & "</p>" %> I think that is the correct syntax....but you get the drift..?!! |
|
#14
|
|||
|
|||
|
Hi,
Just wondering if you had any luck with getting the DB to work with your WYSISYG editor? Let me know if there are any other problems... Kind Regards... |
|
#15
|
|||
|
|||
|
hello,
ya I kinda got it working, not just trying to add on more controls for it, see, I've got a very good one already, but I don't know how to get the java script setup for saving it to a db, so I'm just using yours till I can get the other one working, but it's good practice for me |
|
#16
|
|||
|
|||
|
cool... hope it goes all ok for you!!
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > ASP Development > WYSIWYG Editor help! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|