|
 |
|
Dev Articles Community Forums
> Programming
> ASP Development
|
WYSIWYG Editor help!
Discuss WYSIWYG Editor help! in the ASP Development forum on Dev Articles. WYSIWYG Editor help! ASP Development forum discussing your ASP or Visual Basic problems, solutions and code posts. Active Server Pages help you create dynamic websites using powerful scripting technologies.
|
|
 |
|
|
|

Dev Articles Community Forums Sponsor:
|
|

July 5th, 2002, 09:00 AM
|
Registered User
|
|
Join Date: Jul 2002
Posts: 7
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
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!
|

July 5th, 2002, 09:19 AM
|
Frank The Tank!
|
|
Join Date: Jun 2002
Location: Toronto, Canada
Posts: 1,240
Time spent in forums: < 1 sec
Reputation Power: 17
|
|
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
|

July 5th, 2002, 09:46 AM
|
Registered User
|
|
Join Date: Jul 2002
Posts: 7
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
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,
|

July 5th, 2002, 10:32 AM
|
The calm b4 the storm
|
|
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404
Time spent in forums: < 1 sec
Reputation Power: 16
|
|
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">
|

July 5th, 2002, 10:35 AM
|
The calm b4 the storm
|
|
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404
Time spent in forums: < 1 sec
Reputation Power: 16
|
|
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!
|

July 5th, 2002, 10:51 AM
|
Registered User
|
|
Join Date: Jul 2002
Posts: 7
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
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.
|

July 5th, 2002, 11:05 AM
|
The calm b4 the storm
|
|
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404
Time spent in forums: < 1 sec
Reputation Power: 16
|
|
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..?
|

July 5th, 2002, 11:11 AM
|
Registered User
|
|
Join Date: Jul 2002
Posts: 7
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
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! 
|

July 5th, 2002, 11:19 AM
|
The calm b4 the storm
|
|
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404
Time spent in forums: < 1 sec
Reputation Power: 16
|
|
I have sent you the code now..
Hope it's ok!
|

July 5th, 2002, 12:07 PM
|
Registered User
|
|
Join Date: Jul 2002
Posts: 7
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
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,,?
|

July 5th, 2002, 12:10 PM
|
The calm b4 the storm
|
|
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404
Time spent in forums: < 1 sec
Reputation Power: 16
|
|
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....
|

July 5th, 2002, 12:21 PM
|
Registered User
|
|
Join Date: Jul 2002
Posts: 7
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
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?
|

July 5th, 2002, 12:25 PM
|
The calm b4 the storm
|
|
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404
Time spent in forums: < 1 sec
Reputation Power: 16
|
|
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..?!!
|

July 8th, 2002, 04:20 AM
|
The calm b4 the storm
|
|
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404
Time spent in forums: < 1 sec
Reputation Power: 16
|
|
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...
|

July 8th, 2002, 09:09 AM
|
Registered User
|
|
Join Date: Jul 2002
Posts: 7
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
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
|

July 8th, 2002, 11:22 AM
|
The calm b4 the storm
|
|
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404
Time spent in forums: < 1 sec
Reputation Power: 16
|
|
cool... hope it goes all ok for you!!
|
Developer Shed Advertisers and Affiliates
Thread Tools |
Search this Thread |
|
|
Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|