ASP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingASP Development

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 July 16th, 2002, 10:04 AM
Louis Louis is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2002
Posts: 1 Louis User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Louis
Wysiwyg editor question

I have used Mitchell Harpers code to get a Wysiwyg browser editor working in ASP
I even got it to work, great stuff Mitch !
What I can do now, is generate HTML with the WYSIWYG editor and store it in a database field.
But... what I CAN NOT do yet, is load the saved HTML back into
the WYSIWYG editor to start editing it.

Any help out there on this one ?

code

Reply With Quote
  #2  
Old July 16th, 2002, 10:24 AM
Jeeyer Jeeyer is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Posts: 1 Jeeyer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
just place it in the value attribute of the hidden field.

f.e;

<input type="hidden" name="editorContent" value="<%=yourDatabaseValueHere%>">

et voila.

Reply With Quote
  #3  
Old July 16th, 2002, 12:19 PM
James Yang James Yang is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Atlanta, Georgia
Posts: 284 James Yang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 45 sec
Reputation Power: 7
Send a message via ICQ to James Yang
i think you will need abit more than that cuz mytchs code only transfer the value from the editor to the hidden field not the otehr way around..(is this right? ) so by placing a value for the hidden form won't actually place value to the editor. (i hope im right)

so, what you gotta do is a little bit of js coding.

First, place another hidden form then create a javascript that transfers value from the hidden form to the iView iframe when the page loads.

hope this helps
__________________
Regards,

James Yang
.NET Developer / Network Engineer
MCSE, MCDBA, MCSA, CCNA

http://www.yellowpin.com/
http://www.opentechsupport.com/

Reply With Quote
  #4  
Old July 16th, 2002, 12:20 PM
James Yang James Yang is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Atlanta, Georgia
Posts: 284 James Yang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 45 sec
Reputation Power: 7
Send a message via ICQ to James Yang
I think i've used this technique to make editoworks professional. Have a look at the editworks live demo.

http://www.tools2code.com/editworkspro

Reply With Quote
  #5  
Old July 16th, 2002, 05:58 PM
fakker fakker is offline
The calm b4 the storm
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404 fakker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via Yahoo to fakker
Hi,

I have answered this question a few times to people now.. maybe there should be an article about it on the website??

<thanks>
Just like to say thanks to every1 who helped me with this solution!
</thanks>

right....

1. find the code in the editor (WYSIWYG editor) which writes the iFrame...should be something like:

<iframe id="iView" style="width: 600px; height:200px;" </iframe>

what you need to do is to tell the editor where the SOURCE of the iFrame is... for this you need to change the code above to:

<iframe id="iView" style="width: 600px; height:200px;" src="load.asp?id=<%= id %>"></iframe>

you will see that there is now "src="load.asp?id=<%=id%>""

what this does is when the editor loads it goes away and loads "load.asp"... this page looks up the record in the DB to then return to the iFrame window...

so...

if you loaded load.asp?id=1 then load.asp would return the first record...so in load.asp you need to open the DB and use an SQL statement to open the record where ID = $ID (in URL)

ok so far?......!

so when you call editor.... the value of load.asp is returned to the iFrame window....

that should work for ya! I hope...
let me know if you dont get what I'm on about..!!
regards,
__________________
Matt 'Fakker' Facer

mattfacer.com

Reply With Quote
  #6  
Old July 17th, 2002, 03:58 AM
James Yang James Yang is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Atlanta, Georgia
Posts: 284 James Yang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 45 sec
Reputation Power: 7
Send a message via ICQ to James Yang
what happens if he jsut want to load a text not a value from database?

Reply With Quote
  #7  
Old July 17th, 2002, 12:54 PM
fakker fakker is offline
The calm b4 the storm
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404 fakker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via Yahoo to fakker
if you simply want to load text, either from a text (.txt) file or an HTML file, you can simply change the source of the iFrame.

so if you wanted to load, hello.htm for example, you would have the following line:

<iFrame src="hello.htm";> <iFrame>

.... I am using this now to edit HTML files, but my editor is a PHP file... although it could just as easily be ASP!

I use:

iFrame src="load.php?filename=<?= $filename ?>"><iFrame>

obviously in ASP you would use something like:

iFrame src="load.asp?filename=<%= request.querystring("filename") %>"</iframe>

so the link would look like:

editor.asp?filename=hello.htm

then the contents of hello.htm would be loaded in to the editor window....

Is that what you mean James?

Reply With Quote
  #8  
Old July 17th, 2002, 03:46 PM
James Yang James Yang is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2002
Location: Atlanta, Georgia
Posts: 284 James Yang User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 m 45 sec
Reputation Power: 7
Send a message via ICQ to James Yang
yeah i understand what your saying fakker.


but is that round trip to server necessary if you just want a text displayed not content of a file?

Say, you want the editor to have initial text or comfirmation of some sort "from the server". I would just make another hidden field and js which puts the content of the hidden field to the editor when the page is loaded.

Using this tehnique, u can even load the page if you want to. U open the file from the server.


do you know what i mean?

Reply With Quote
  #9  
Old July 17th, 2002, 06:42 PM
fakker fakker is offline
The calm b4 the storm
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404 fakker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via Yahoo to fakker
aah ok.....I see what u mean...

to get initial text displayed in the window, you could write in to the init() function the default text... like....


var src = "this is the default text";

function Init()
{
iView.document.designMode = 'On';
iframeWin = window.frames.iView;
iframeWin.document.open();
iframeWin.document.write(src);
iframeWin.document.close();

}

then when init is called, it displayed the value of "src" which in this case is "this is the default text".

You could also make a button to set the value of src.... for example...

function write_hello()
{
iframe.Win.Document.write('hello');
}

function write_tester()
{
iframe.Win.Document.write('tester');
}

then you could have a button or hyper link on the editor page which might be like:

click here to write "hello" in the window
then you would create a hyperlink such as:

<a href="#" onClick="write_tester()";>Click me</a>

or something like that! I have not tried this, so all this code is simply an assumption that it will work.... it should do though!!

lol!


Reply With Quote
  #10  
Old August 21st, 2003, 02:41 AM
esthera esthera is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 20 esthera User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
wysing editing

I am trying to use what was posted here that in the iframe I put src=load.asp&id=id and in load.asp I open the recordset.

Somehow the iframe is not pulling in the data correctly. How do I pass it from load.asp to the iframe

Reply With Quote
  #11  
Old August 21st, 2003, 04:28 AM
fakker fakker is offline
The calm b4 the storm
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2002
Location: Manchester, UK
Posts: 404 fakker User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via Yahoo to fakker
when you open load.asp?id=X on its own does it show the record?

also, make sure you dont have any of the iframeWin.document.write(src); stuff in the init function. You dont want anything being written to the iFrame apart from the src...

if you have any code or an example we could look at, that may help also...

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingASP Development > Wysiwyg editor question


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

 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

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





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