Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_web_howto thread: Rich Text Box in a form


Message #1 by emohara@k... on Mon, 22 Jan 2001 19:27:39 -0000
I'm working on some sort of log book project...

the users like to have pictures and formatted text, solution = rich text

box control... it works great, its just a text field on SQL but with

<PARM name = "TextRTF" value = "<%Recordset("txtLog")%>"> 

it plugs it in Rich text format, picture even executables show up fine

(just a beast on storage). Only problem is, I can't make a form see the

rich text box... I did a

for each item in Form

 Response.Write Form.item

blah blah blah...

and everything showed up except the rich text box... 

how can i fix it???

Thanks (whoever figured this out is a genius)

Message #2 by "Ken Schaefer" <ken@a...> on Tue, 23 Jan 2001 11:43:24 +1100
Are you talking about a HTML form?



HTML forms *only use* HTML - you need to use HTML tags to emulate your rich

text formatting.



Apologies if I misunderstood your question.



Cheers

Ken



----- Original Message -----

From: <emohara@k...>

To: "ASP Web HowTo" <asp_web_howto@p...>

Sent: Tuesday, January 23, 2001 6:27 AM

Subject: [asp_web_howto] Rich Text Box in a form





> I'm working on some sort of log book project...

> the users like to have pictures and formatted text, solution = rich text

> box control... it works great, its just a text field on SQL but with

> <PARM name = "TextRTF" value = "<%Recordset("txtLog")%>">

> it plugs it in Rich text format, picture even executables show up fine

> (just a beast on storage). Only problem is, I can't make a form see the

> rich text box... I did a

> for each item in Form

>  Response.Write Form.item

> blah blah blah...

> and everything showed up except the rich text box...

> how can i fix it???

> Thanks (whoever figured this out is a genius)





Message #3 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Tue, 23 Jan 2001 09:25:22 -0000
Does your rich text box output HTML?  if not, then its not going to be much

use for displaying the info back again in the browser, except via the same

control.



I've done a similar thing in the past, using the Microsoft IE5 DHTML Edit

control.  This is an activeX control which comes with IE5 (full SDK

available from Microsoft website... somewhere!).  It has a full "word" style

interface, allowing any form of rich text to be either written or cut and

pasted in, and formatted however you like.  The beauty of it is that it

outputs the contents as HTML via a property.



To submit this generated HTML to the server, I created a standard textarea,

which was hidden from the user using CSS (style="display:none").  Then, in

the onSubmit function, I copied the HTML from the Edit Control to the

textarea, and so it was submitted with the rest of the form.  I used a

textarea ratehr than a hidden field, because hidden fields couldn't handle

being passed a string which contained CRLF characters, whcih the textare can

handle no problem.



-----Original Message-----

From: emohara@k... [mailto:emohara@k...]

Sent: Monday, January 22, 2001 7:28 PM

To: ASP Web HowTo

Subject: [asp_web_howto] Rich Text Box in a form





I'm working on some sort of log book project...

the users like to have pictures and formatted text, solution = rich text

box control... it works great, its just a text field on SQL but with

<PARM name = "TextRTF" value = "<%Recordset("txtLog")%>"> 

it plugs it in Rich text format, picture even executables show up fine

(just a beast on storage). Only problem is, I can't make a form see the

rich text box... I did a

for each item in Form

 Response.Write Form.item

blah blah blah...

and everything showed up except the rich text box... 

how can i fix it???

Thanks (whoever figured this out is a genius)

________________________________________________________________________

Scottish Enterprise Network

http://www.scottish-enterprise.com

Message #4 by "O'Hara, Elliott M" <EMOHARA@k...> on Tue, 23 Jan 2001 07:21:00 -0500
How did you copy it??

Do you have the code anywhere? 

Thanks a whole lot for the help, 

I've looked all over and never seen this done and could find no help

anywhere.

Also the DHTML edit control sounds wonderful, can is submit just RTF, not

HTML?

I want to keep the data submited RTF if at all possible. 

Thanks,

Elliott



-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Tuesday, January 23, 2001 4:25 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





Does your rich text box output HTML?  if not, then its not going to be much

use for displaying the info back again in the browser, except via the same

control.



I've done a similar thing in the past, using the Microsoft IE5 DHTML Edit

control.  This is an activeX control which comes with IE5 (full SDK

available from Microsoft website... somewhere!).  It has a full "word" style

interface, allowing any form of rich text to be either written or cut and

pasted in, and formatted however you like.  The beauty of it is that it

outputs the contents as HTML via a property.



To submit this generated HTML to the server, I created a standard textarea,

which was hidden from the user using CSS (style="display:none").  Then, in

the onSubmit function, I copied the HTML from the Edit Control to the

textarea, and so it was submitted with the rest of the form.  I used a

textarea ratehr than a hidden field, because hidden fields couldn't handle

being passed a string which contained CRLF characters, whcih the textare can

handle no problem.



-----Original Message-----

From: emohara@k... [mailto:emohara@k...]

Sent: Monday, January 22, 2001 7:28 PM

To: ASP Web HowTo

Subject: [asp_web_howto] Rich Text Box in a form





I'm working on some sort of log book project...

the users like to have pictures and formatted text, solution = rich text

box control... it works great, its just a text field on SQL but with

<PARM name = "TextRTF" value = "<%Recordset("txtLog")%>"> 

it plugs it in Rich text format, picture even executables show up fine

(just a beast on storage). Only problem is, I can't make a form see the

rich text box... I did a

for each item in Form

 Response.Write Form.item

blah blah blah...

and everything showed up except the rich text box... 

how can i fix it???

Thanks (whoever figured this out is a genius)

________________________________________________________________________

Scottish Enterprise Network

http://www.scottish-enterprise.com

Message #5 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Tue, 23 Jan 2001 15:08:53 -0000
the text was copied by



txt.value = oControl.innerHTML



or something like that...  



It was last year, in a different job that I did this, so I can't provide you

with a proper example.



But you can download everything you need from



http://msdn.microsoft.com/Downloads/samples/Internet/browser/editcntrl/sampl

e.asp



-----Original Message-----

From: O'Hara, Elliott M [mailto:EMOHARA@k...]

Sent: Tuesday, January 23, 2001 12:21 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





How did you copy it??

Do you have the code anywhere? 

Thanks a whole lot for the help, 

I've looked all over and never seen this done and could find no help

anywhere.

Also the DHTML edit control sounds wonderful, can is submit just RTF, not

HTML?

I want to keep the data submited RTF if at all possible. 

Thanks,

Elliott



-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Tuesday, January 23, 2001 4:25 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





Does your rich text box output HTML?  if not, then its not going to be much

use for displaying the info back again in the browser, except via the same

control.



I've done a similar thing in the past, using the Microsoft IE5 DHTML Edit

control.  This is an activeX control which comes with IE5 (full SDK

available from Microsoft website... somewhere!).  It has a full "word" style

interface, allowing any form of rich text to be either written or cut and

pasted in, and formatted however you like.  The beauty of it is that it

outputs the contents as HTML via a property.



To submit this generated HTML to the server, I created a standard textarea,

which was hidden from the user using CSS (style="display:none").  Then, in

the onSubmit function, I copied the HTML from the Edit Control to the

textarea, and so it was submitted with the rest of the form.  I used a

textarea ratehr than a hidden field, because hidden fields couldn't handle

being passed a string which contained CRLF characters, whcih the textare can

handle no problem.



-----Original Message-----

From: emohara@k... [mailto:emohara@k...]

Sent: Monday, January 22, 2001 7:28 PM

To: ASP Web HowTo

Subject: [asp_web_howto] Rich Text Box in a form





I'm working on some sort of log book project...

the users like to have pictures and formatted text, solution = rich text

box control... it works great, its just a text field on SQL but with

<PARM name = "TextRTF" value = "<%Recordset("txtLog")%>"> 

it plugs it in Rich text format, picture even executables show up fine

(just a beast on storage). Only problem is, I can't make a form see the

rich text box... I did a

for each item in Form

 Response.Write Form.item

blah blah blah...

and everything showed up except the rich text box... 

how can i fix it???

Thanks (whoever figured this out is a genius)

________________________________________________________________________

Scottish Enterprise Network

http://www.scottish-enterprise.com

Message #6 by "O'Hara, Elliott M" <EMOHARA@k...> on Tue, 23 Jan 2001 15:43:25 -0500
thanks a load... I've got this working perfectly...

Users can even drag exe's into the Rich Text Box, and SQL stores it as a

text field. 



About the DHTML for IE5 Editor,

Does it have the text editing controls? 

As it sits now, I'm coding buttons for italic, bullits and so forth, I know

that somewhere there has to be some control that does this...

Is there? or is that just wishful thinking?

Message #7 by "Eric Van Camp" <eric.vancamp@c...> on Tue, 23 Jan 2001 22:31:43 -0000
hi i need to have that one too!!!

please could you provide me with coding material to see how I could use the

activeX of ie 5.5 to edit text in the box!

txs

eric

Message #8 by "O'Hara, Elliott M" <EMOHARA@k...> on Wed, 24 Jan 2001 07:22:48 -0500
<OBJECT id=RichTextBox style="LEFT: 0px; WIDTH: 626px; TOP: 0px; HEIGHT:

427px" 

classid="clsid:3B7C8860-D78F-101B-B9B5-04021C009402" width=626 height=427>

</OBJECT>



Add a hidden input box....

<input type = "hidden" id = hidden>



Client side event handler



SUB yourform_onsubmit



hidden.value = RichTextBox.TextRTF



END SUB



As far as allowing the users to change fonts ect... I coded all the buttons

myself. Theres probably a better way, but I couldn't find it...

Anyone know about an activex control text formatting bar...



heres what I had to do



SUB BtnItalic_onClick



IF Rich.SelItalic = True THEN

	Rich.SelItalic = False

ELSE 

	Rich.SelItalic = TRUE

END IF

END SUB



did the same basic thing for font size, color ect... rather tedious, but

works great...

As long as you submit the data in a SQL Text field (I'm not sure what to use

for Access- I only use SQL) and view the data in any RTF viewer (Word,

Wordpad, a Rich TextBox) you're good to go...



Hope that helped...



Elliott









-----Original Message-----

From: Eric Van Camp [mailto:eric.vancamp@c...]

Sent: Tuesday, January 23, 2001 5:32 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





hi i need to have that one too!!!

please could you provide me with coding material to see how I could use the

activeX of ie 5.5 to edit text in the box!

txs

eric

Message #9 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Wed, 24 Jan 2001 13:05:55 -0000
The samples that you get if you go to that URL I gave yesterday

(http://msdn.microsoft.com/Downloads/samples/Internet/browser/editcntrl/samp

le.asp) have all this done already, made to look like word.  You can take

this as your starting point and remove any buttons you don't want.



-----Original Message-----

From: O'Hara, Elliott M [mailto:EMOHARA@k...]

Sent: Tuesday, January 23, 2001 8:43 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





thanks a load... I've got this working perfectly...

Users can even drag exe's into the Rich Text Box, and SQL stores it as a

text field. 



About the DHTML for IE5 Editor,

Does it have the text editing controls? 

As it sits now, I'm coding buttons for italic, bullits and so forth, I know

that somewhere there has to be some control that does this...

Is there? or is that just wishful thinking?

________________________________________________________________________

Scottish Enterprise Network

http://www.scottish-enterprise.com



Message #10 by "O'Hara, Elliott M" <EMOHARA@k...> on Wed, 24 Jan 2001 08:19:54 -0500
I tried that link..

Unavailable???

-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Wednesday, January 24, 2001 8:06 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





The samples that you get if you go to that URL I gave yesterday

(http://msdn.microsoft.com/Downloads/samples/Internet/browser/editcntrl/samp

le.asp) have all this done already, made to look like word.  You can take

this as your starting point and remove any buttons you don't want.



-----Original Message-----

From: O'Hara, Elliott M [mailto:EMOHARA@k...]

Sent: Tuesday, January 23, 2001 8:43 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





thanks a load... I've got this working perfectly...

Users can even drag exe's into the Rich Text Box, and SQL stores it as a

text field. 



About the DHTML for IE5 Editor,

Does it have the text editing controls? 

As it sits now, I'm coding buttons for italic, bullits and so forth, I know

that somewhere there has to be some control that does this...

Is there? or is that just wishful thinking?

________________________________________________________________________

Scottish Enterprise Network

http://www.scottish-enterprise.com



Message #11 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Wed, 24 Jan 2001 14:04:23 -0000
thats because "le.asp" has been chopped off the end



-----Original Message-----

From: O'Hara, Elliott M [mailto:EMOHARA@k...]

Sent: Wednesday, January 24, 2001 1:20 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





I tried that link..

Unavailable???

-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Wednesday, January 24, 2001 8:06 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





The samples that you get if you go to that URL I gave yesterday

(http://msdn.microsoft.com/Downloads/samples/Internet/browser/editcntrl/samp

le.asp) have all this done already, made to look like word.  You can take

this as your starting point and remove any buttons you don't want.



-----Original Message-----

From: O'Hara, Elliott M [mailto:EMOHARA@k...]

Sent: Tuesday, January 23, 2001 8:43 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





thanks a load... I've got this working perfectly...

Users can even drag exe's into the Rich Text Box, and SQL stores it as a

text field. 



About the DHTML for IE5 Editor,

Does it have the text editing controls? 

As it sits now, I'm coding buttons for italic, bullits and so forth, I know

that somewhere there has to be some control that does this...

Is there? or is that just wishful thinking?

________________________________________________________________________

Scottish Enterprise Network

http://www.scottish-enterprise.com



Message #12 by "O'Hara, Elliott M" <EMOHARA@k...> on Wed, 24 Jan 2001 09:07:15 -0500
Alex,

	Thanks... I'm just an idiot.. your link was on two lines... Clicking

on it didn't work!

DUH!



-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Wednesday, January 24, 2001 8:06 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





The samples that you get if you go to that URL I gave yesterday

(http://msdn.microsoft.com/Downloads/samples/Internet/browser/editcntrl/samp

le.asp) have all this done already, made to look like word.  You can take

this as your starting point and remove any buttons you don't want.



-----Original Message-----

From: O'Hara, Elliott M [mailto:EMOHARA@k...]

Sent: Tuesday, January 23, 2001 8:43 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





thanks a load... I've got this working perfectly...

Users can even drag exe's into the Rich Text Box, and SQL stores it as a

text field. 



About the DHTML for IE5 Editor,

Does it have the text editing controls? 

As it sits now, I'm coding buttons for italic, bullits and so forth, I know

that somewhere there has to be some control that does this...

Is there? or is that just wishful thinking?

________________________________________________________________________

Scottish Enterprise Network

http://www.scottish-enterprise.com



Message #13 by "O'Hara, Elliott M" <EMOHARA@k...> on Wed, 24 Jan 2001 10:06:31 -0500
yeah.. i caught that... I'm working on it now...

Its beautiful... except I need RTF - not HTML....

Have you seen one that deos the same- except to Rich Text?

If not I'm goijng through all 10 million lines (Slight exageration) and

changing ti to work with RTF





-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Wednesday, January 24, 2001 9:04 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





thats because "le.asp" has been chopped off the end



-----Original Message-----

From: O'Hara, Elliott M [mailto:EMOHARA@k...]

Sent: Wednesday, January 24, 2001 1:20 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





I tried that link..

Unavailable???

-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Wednesday, January 24, 2001 8:06 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





The samples that you get if you go to that URL I gave yesterday

(http://msdn.microsoft.com/Downloads/samples/Internet/browser/editcntrl/samp

le.asp) have all this done already, made to look like word.  You can take

this as your starting point and remove any buttons you don't want.



-----Original Message-----

From: O'Hara, Elliott M [mailto:EMOHARA@k...]

Sent: Tuesday, January 23, 2001 8:43 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





thanks a load... I've got this working perfectly...

Users can even drag exe's into the Rich Text Box, and SQL stores it as a

text field. 



About the DHTML for IE5 Editor,

Does it have the text editing controls? 

As it sits now, I'm coding buttons for italic, bullits and so forth, I know

that somewhere there has to be some control that does this...

Is there? or is that just wishful thinking?

________________________________________________________________________

Scottish Enterprise Network

http://www.scottish-enterprise.com

Message #14 by "Wally Burfine" <oopconsultant@h...> on Wed, 24 Jan 2001 16:04:01 -0000
the url link wraps around the line so you have to cut and paste the full url 

to get to it.





>From: "O'Hara, Elliott M" <EMOHARA@k...>

>Reply-To: "ASP Web HowTo" <asp_web_howto@p...>

>To: "ASP Web HowTo" <asp_web_howto@p...>

>Subject: [asp_web_howto] RE: Rich Text Box in a form

>Date: Wed, 24 Jan 2001 08:19:54 -0500

>

>I tried that link..

>Unavailable???

>-----Original Message-----

>From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

>Sent: Wednesday, January 24, 2001 8:06 AM

>To: ASP Web HowTo

>Subject: [asp_web_howto] RE: Rich Text Box in a form

>

>

>The samples that you get if you go to that URL I gave yesterday

>(http://msdn.microsoft.com/Downloads/samples/Internet/browser/editcntrl/samp

>le.asp) have all this done already, made to look like word.  You can take

>this as your starting point and remove any buttons you don't want.

>

>-----Original Message-----

>From: O'Hara, Elliott M [mailto:EMOHARA@k...]

>Sent: Tuesday, January 23, 2001 8:43 PM

>To: ASP Web HowTo

>Subject: [asp_web_howto] RE: Rich Text Box in a form

>

>

>thanks a load... I've got this working perfectly...

>Users can even drag exe's into the Rich Text Box, and SQL stores it as a

>text field.

>

>About the DHTML for IE5 Editor,

>Does it have the text editing controls?

>As it sits now, I'm coding buttons for italic, bullits and so forth, I know

>that somewhere there has to be some control that does this...

>Is there? or is that just wishful thinking?

>________________________________________________________________________

>Scottish Enterprise Network

>http://www.scottish-enterprise.com

>

>
Message #15 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Wed, 24 Jan 2001 15:50:26 -0000
No... I used that one because I was letting the user create their own pages

on the fly, and so the ability to create formatted HTML that could be saved

straight away was the priority.



I originally wanted to find something that could actually take rich text

input and convert it to HTML, but after searching long and hard on the web

all I found was one component that some guy had written, which didn't do the

job very well.  Then I found out about that control, and abandoned the idea

of using rtf altogether...



-----Original Message-----

From: O'Hara, Elliott M [mailto:EMOHARA@k...]

Sent: Wednesday, January 24, 2001 3:07 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





yeah.. i caught that... I'm working on it now...

Its beautiful... except I need RTF - not HTML....

Have you seen one that deos the same- except to Rich Text?

If not I'm goijng through all 10 million lines (Slight exageration) and

changing ti to work with RTF





-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Wednesday, January 24, 2001 9:04 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





thats because "le.asp" has been chopped off the end



-----Original Message-----

From: O'Hara, Elliott M [mailto:EMOHARA@k...]

Sent: Wednesday, January 24, 2001 1:20 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





I tried that link..

Unavailable???

-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Wednesday, January 24, 2001 8:06 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





The samples that you get if you go to that URL I gave yesterday

(http://msdn.microsoft.com/Downloads/samples/Internet/browser/editcntrl/samp

le.asp) have all this done already, made to look like word.  You can take

this as your starting point and remove any buttons you don't want.



-----Original Message-----

From: O'Hara, Elliott M [mailto:EMOHARA@k...]

Sent: Tuesday, January 23, 2001 8:43 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





thanks a load... I've got this working perfectly...

Users can even drag exe's into the Rich Text Box, and SQL stores it as a

text field. 



About the DHTML for IE5 Editor,

Does it have the text editing controls? 

As it sits now, I'm coding buttons for italic, bullits and so forth, I know

that somewhere there has to be some control that does this...

Is there? or is that just wishful thinking?

________________________________________________________________________

Scottish Enterprise Network

http://www.scottish-enterprise.com

Message #16 by "O'Hara, Elliott M" <EMOHARA@k...> on Wed, 24 Jan 2001 11:12:38 -0500
Well, in about two days there will be one that works.... 

Thanks for your help...



-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Wednesday, January 24, 2001 10:50 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





No... I used that one because I was letting the user create their own pages

on the fly, and so the ability to create formatted HTML that could be saved

straight away was the priority.



I originally wanted to find something that could actually take rich text

input and convert it to HTML, but after searching long and hard on the web

all I found was one component that some guy had written, which didn't do the

job very well.  Then I found out about that control, and abandoned the idea

of using rtf altogether...



-----Original Message-----

From: O'Hara, Elliott M [mailto:EMOHARA@k...]

Sent: Wednesday, January 24, 2001 3:07 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





yeah.. i caught that... I'm working on it now...

Its beautiful... except I need RTF - not HTML....

Have you seen one that deos the same- except to Rich Text?

If not I'm goijng through all 10 million lines (Slight exageration) and

changing ti to work with RTF





-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Wednesday, January 24, 2001 9:04 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





thats because "le.asp" has been chopped off the end



-----Original Message-----

From: O'Hara, Elliott M [mailto:EMOHARA@k...]

Sent: Wednesday, January 24, 2001 1:20 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





I tried that link..

Unavailable???

-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Wednesday, January 24, 2001 8:06 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





The samples that you get if you go to that URL I gave yesterday

(http://msdn.microsoft.com/Downloads/samples/Internet/browser/editcntrl/samp

le.asp) have all this done already, made to look like word.  You can take

this as your starting point and remove any buttons you don't want.



-----Original Message-----

From: O'Hara, Elliott M [mailto:EMOHARA@k...]

Sent: Tuesday, January 23, 2001 8:43 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





thanks a load... I've got this working perfectly...

Users can even drag exe's into the Rich Text Box, and SQL stores it as a

text field. 



About the DHTML for IE5 Editor,

Does it have the text editing controls? 

As it sits now, I'm coding buttons for italic, bullits and so forth, I know

that somewhere there has to be some control that does this...

Is there? or is that just wishful thinking?

________________________________________________________________________

Scottish Enterprise Network

http://www.scottish-enterprise.com

Message #17 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Wed, 24 Jan 2001 17:03:08 -0000
how are you doing the conversion from RTF to HTML?  Have you written the

whole thing yourself, or did you find a good third party component?



-----Original Message-----

From: O'Hara, Elliott M [mailto:EMOHARA@k...]

Sent: Wednesday, January 24, 2001 4:13 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





Well, in about two days there will be one that works.... 

Thanks for your help...



-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Wednesday, January 24, 2001 10:50 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





No... I used that one because I was letting the user create their own pages

on the fly, and so the ability to create formatted HTML that could be saved

straight away was the priority.



I originally wanted to find something that could actually take rich text

input and convert it to HTML, but after searching long and hard on the web

all I found was one component that some guy had written, which didn't do the

job very well.  Then I found out about that control, and abandoned the idea

of using rtf altogether...



-----Original Message-----

From: O'Hara, Elliott M [mailto:EMOHARA@k...]

Sent: Wednesday, January 24, 2001 3:07 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





yeah.. i caught that... I'm working on it now...

Its beautiful... except I need RTF - not HTML....

Have you seen one that deos the same- except to Rich Text?

If not I'm goijng through all 10 million lines (Slight exageration) and

changing ti to work with RTF





-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Wednesday, January 24, 2001 9:04 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





thats because "le.asp" has been chopped off the end



-----Original Message-----

From: O'Hara, Elliott M [mailto:EMOHARA@k...]

Sent: Wednesday, January 24, 2001 1:20 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





I tried that link..

Unavailable???

-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Wednesday, January 24, 2001 8:06 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





The samples that you get if you go to that URL I gave yesterday

(http://msdn.microsoft.com/Downloads/samples/Internet/browser/editcntrl/samp

le.asp) have all this done already, made to look like word.  You can take

this as your starting point and remove any buttons you don't want.



-----Original Message-----

From: O'Hara, Elliott M [mailto:EMOHARA@k...]

Sent: Tuesday, January 23, 2001 8:43 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





thanks a load... I've got this working perfectly...

Users can even drag exe's into the Rich Text Box, and SQL stores it as a

text field. 



About the DHTML for IE5 Editor,

Does it have the text editing controls? 

As it sits now, I'm coding buttons for italic, bullits and so forth, I know

that somewhere there has to be some control that does this...

Is there? or is that just wishful thinking?

________________________________________________________________________

Scottish Enterprise Network

http://www.scottish-enterprise.com

Message #18 by "O'Hara, Elliott M" <EMOHARA@k...> on Wed, 24 Jan 2001 12:44:00 -0500
I changed the class id to a rich text box. Now I'm recoding the buttons that

I need to change the RTF formatting.



Do you know much JavaScript??

The font Color is killing me...

I'm passing the variable fine, but when I plug it into the

richtextbox.selcolor, its trying to set the color to the variable name.

Message #19 by Imar Spaanjaars <Imar@S...> on Wed, 24 Jan 2001 21:34:32 +0100
For those of you interested:



I tried to attach an HTML file which renders a rich text (HTML) box in a 

client (IE only) It has it's own Word-like toolbar for actions like bold, 

italic and hyperlinks.

I also lets you switch between HTML and plain text.

Unfortunately, Lyris let my mail bounce because it had an attachment. I can 

past the HTML here, but the graphic is an integral part of it. If somebody 

is interested, send me a mail (directly, instead of lots of "Me too" posts 

here) and I'll send it to you.



Check it out, if you want to. The code is rather a mess (and quite old), 

but it should be easy to extract the text area, so you can copy it's 

contents to a hidden textarea on submit, and leave everything else as is.

I have used it a project some time ago, when neither of us knew why it was 

working, but we knew it did ;-) If somebody feels like cleaning it a 

little, I am interested in a clean copy too. Just haven't had the time yet.





HtH



Imar



<CODE TYPE="messy">





<TITLE>Message Editor</TITLE>

<STYLE>

SELECT {font:8pt verdana,arial,sans-serif;background:#EEEEFF}

.toolbar 

{margin-bottom:3pt;height:28;overflow:hidden;background:lightgrey;border:1px 

black solid}

.mode LABEL {font:bold 10pt verdana,geneva,arial,sans-serif}

.mode .current {color:darkgreen}

.heading {color:navy;background:lightgrey}

</STYLE>

<SCRIPT>



var bLoad=false

public_description=new Editor



function Editor() {

this.put_html=put_html;

this.get_html=get_html;

this.testHTML=testHTML

}

function testHTML(bAllowHead,extras) {

   mW.click()

   var badStuff=new 

Array("IFRAME","SCRIPT","LAYER","ILAYER","OBJECT","APPLET","EMBED","FORM","INPUT","BUTTON","TEXTAREA"),headStuff=new 

Array("HTML","BODY","TITLE","BASE","LINK","META","STYLE"),hasStuff=new 

Array(),bodyTags=idEdit.document.body.all,i=0

   for (i=0;i<badStuff.length;i++)

     if (bodyTags.tags(badStuff[i]).length>0)

       hasStuff[hasStuff.length]=badStuff[i]

   if (!bAllowHead)

     for (i=0;i<headStuff.length;i++)

       if (bodyTags.tags(headStuff[i]).length>0)

         hasStuff[hasStuff.length]=headStuff[i]

   if (extras!=null)

     for (i=0;i<extras.length;i++)

       if (bodyTags.tags(extras[i]).length>0)

         hasStuff[hasStuff.length]=extras[i]

   for (i=bodyTags.tags("FONT").length-1;i >= 0;i--)

         if (bodyTags.tags("FONT")[i].style.backgroundColor="#ffffff") {

                 bodyTags.tags("FONT")[i].style.backgroundColor=""

                 if 

(bodyTags.tags("FONT")[i].outerHTML.substring(0,6)=="<FONT>")

                         bodyTags.tags("FONT")[i].outerHTML=bodyTags.tags("FONT")[i].innerHTML

         }

   var str=""

   if (hasStuff.length>0) {

     str="Please remove the following HTML Tags from your message and 

resubmit:"

     for (i=0;i<hasStuff.length;i++)

        str+="\n "+hasStuff[i]

     str+= "\nRemember, when using HTML Mode you may need to escape \nthe 

brackets surrounding tags (< and >) with < and >"

     setTimeout("mH.click()",0)

   }

   return str

}

function get_html() {

if (bMode)

return idEdit.document.body.innerHTML

else

return idEdit.document.body.innerText;

}

function put_html(sVal) {

if (bMode)

idEdit.document.body.innerHTML=sVal

else

idEdit.document.body.innerText=sVal

}



var sHeader="<BODY STYLE=\"font:10pt 

geneva,arial,sans-serif\">",bMode=true,sel=null,strErr="Formatting toolbar 

is only accessible in WYSIWYG mode"

function format(what,opt) {

  if (!bMode) {

    alert(strErr);idEdit.focus();return

  }

  if (opt=="removeFormat") {

    what=opt;opt=null

  }

  if (bMode) {

    if (opt==null)

      idEdit.document.execCommand(what)

    else

      idEdit.document.execCommand(what,"",opt)

    var s=idEdit.document.selection.createRange(),p=s.parentElement()

    if ((p.tagName=="FONT") && (p.style.backgroundColor!=""))

      p.outerHTML=p.innerHTML

    idEdit.focus()

  }

  sel=null

}



function getEl(sTag,start) {

   while ((start!=null) && (start.tagName!=sTag))

     start = start.parentElement

   return start

}



function createLink() {

  if (!bMode) {

   alert(strErr);idEdit.focus();return

  }

  var isA = getEl("A",idEdit.document.selection.createRange().parentElement())

  var str=prompt("Where do you want to link to?",isA ? isA.href : "http:\/\/")

  if ((str!=null) && (str!="http://")) {

    if ((idEdit.document.selection.type=="None") && (!isA)) {

      var sel=idEdit.document.selection.createRange()

      sel.pasteHTML("<A HREF=\""+str+"\">"+str+"</A> ")

      sel.select()

    }

    else

      format("CreateLink",str)

  }

  else

    idEdit.focus()

}



function setMode(bNewMode) {

  if (bNewMode!=bMode) {

   if (bNewMode) {

    var sContents=idEdit.document.body.innerText

    idEdit.document.open()

    idEdit.document.write(sHeader)

    idEdit.document.close()

    idEdit.document.body.innerHTML=sContents

   }

   else {

    var fonts=idEdit.document.body.all.tags("FONT")

    for (var i=0;i<fonts.length;i++)

     if (fonts[i].style.backgroundColor!="")

      fonts[i].outerHTML=fonts[i].innerHTML;

    var sContents=idEdit.document.body.innerHTML

    idEdit.document.open()

    idEdit.document.write("<BODY style=\"font:10pt courier, monospace\">")

    idEdit.document.close()

    idEdit.document.body.innerText=sContents

   }

   bMode=bNewMode

   for (var i=0;i<htmlOnly.children.length;i++)

    htmlOnly.children[i].disabled=(!bMode)

  }

  modeA.className=bMode?"current":"";modeB.className=bMode?"":"current"

  idEdit.focus()

}

</SCRIPT>

<BODY ONLOAD="bLoad=true;idBox.style.visibility=''" 

STYLE="margin:0pt;padding:2pt">

<DIV ID=idBox STYLE="width: 98%;height: 98%;text-align: center;visibility: 

hidden">

<TABLE ID=tb1 class=toolbar CELLSPACING=2 CELLPADDING=0 STYLE="padding-top: 

1pt;margin-bottom: 2pt"><TR><TD VALIGN=MIDDLE NOWRAP ID=htmlOnly>

<SELECT 

ONCHANGE="format('formatBlock',this[this.selectedIndex].value);this.selectedIndex=0">

<OPTION CLASS=heading SELECTED>Paragraph<OPTION VALUE="<P>">Normal 

<P><OPTION VALUE="<H1>">Heading 1 <H1><OPTION 

VALUE="<H2>">Heading 2 <H2><OPTION VALUE="<H3>">Heading 3 

<H3><OPTION VALUE="<H4>">Heading 4 <H4><OPTION 

VALUE="<H5>">Heading 5 <H5><OPTION VALUE="<H6>">Heading 6 

<H6><OPTION VALUE="<PRE>">Pre <PRE><OPTION VALUE="removeFormat" 

STYLE="color: darkred">Clear Formatting

</SELECT>  

<SELECT 

ONCHANGE="format('fontname',this[this.selectedIndex].value);this.selectedIndex=0">

<OPTION CLASS=heading SELECTED>Font<OPTION 

VALUE="geneva,arial,sans-serif">Arial<OPTION 

VALUE="verdana,geneva,arial,sans-serif">Verdana<OPTION 

VALUE="times,serif">Times<OPTION VALUE="courier, monospace">Courier

</SELECT><SELECT 

ONCHANGE="format('fontSize',this[this.selectedIndex].text);this.selectedIndex=0">

<OPTION 

CLASS=heading>Size<OPTION>1<OPTION>2<OPTION>3<OPTION>4<OPTION>5<OPTION>6<OPTION>7

</SELECT><SELECT 

ONCHANGE="format('forecolor',this[this.selectedIndex].style.color);this.selectedIndex=0">

<OPTION CLASS=heading SELECTED>Color<OPTION STYLE="color: 

black">Black<OPTION STYLE="color: Gray">Gray<OPTION STYLE="color: 

DarkRed">Dark Red<OPTION STYLE="color: navy">Navy<OPTION STYLE="color: 

darkgreen">Dark Green

</SELECT>

</TD></TR></TABLE>

<DIV ID=tb2 class=toolbar STYLE="width: 270" ONSELECTSTART="return false" 

ONDRAGSTART="return false">

<SCRIPT>

var buttons=new Array(24,23,23,4,23,23,23,4,23,23,23,23,4,24),action=new 

Array("bold","italic","underline","","justifyleft","justifycenter","justifyright","","insertorderedlist","insertunorderedlist","outd
ent","indent","","createLink"),tooltip=new 

Array("Bold Text","Italic Text","Underline Text","","Left Justify","Center 

Justify","Right Justify","","Ordered List","Unordered List","Remove 

Indent","Indent","","Create Hyperlink"),left=0,s=""

for (var i=0;i<buttons.length;i++) {

  s+="<SPAN STYLE='position:relative;height:26;width: " + buttons[i] + 

"'><SPAN 

STYLE='position:absolute;margin:0px;padding:0;height:26;top:0;left:0;width:" 

+ (buttons[i]) + ";clip:rect(0 "+buttons[i]+" 25 

"+0+");overflow:hidden'><IMG BORDER=0 SRC='toolbar.gif' 

STYLE='position:absolute;top:0;left:-" + left + "' WIDTH=267 HEIGHT=50"

  if (buttons[i]!=4) {

    s+=" onmouseover='this.style.top=-25' onmouseout='this.style.top=0' 

ONCLICK=\""

    if (action[i]!="createLink")

      s+="format('" + action[i] + "');this.style.top=0\" "

    else

    s+="createLink();this.style.top=0\" "

    s+="TITLE=\"" + tooltip[i] + "\""

  }

  s+="></SPAN></SPAN>"

  left+=buttons[i]

}

document.write(s)

</SCRIPT>

</DIV>

<IFRAME NAME=idEdit WIDTH=500 HEIGHT=280></IFRAME>

<DIV ID=tb3 class=mode><NOBR><INPUT CHECKED TYPE=radio NAME=rMode ID=mW 

ONCLICK="setMode(true)"><LABEL class=current FOR=mw ID=modeA>WYSIWYG 

Mode</LABEL> <INPUT TYPE=radio NAME=rMode ID=mH 

ONCLICK="setMode(false)"><LABEL FOR=mH ID=modeB>HTML Text 

Mode</LABEL></NOBR></DIV>

<SCRIPT>



idEdit.document.open()

idEdit.document.write(sHeader)

idEdit.document.close()

idEdit.document.designMode="On"

// 

setTimeout("document.all.idEdit.style.height=document.body.offsetHeight-90;idEdit.focus()",0)

// window.onresize = new 

Function("document.all.idEdit.style.height=document.body.offsetHeight-90;")

</SCRIPT>

</DIV>





</code>







At 12:44 PM 1/24/2001 -0500, you wrote:

>I changed the class id to a rich text box. Now I'm recoding the buttons that

>I need to change the RTF formatting.

>

>Do you know much JavaScript??

>The font Color is killing me...

>I'm passing the variable fine, but when I plug it into the

>richtextbox.selcolor, its trying to set the color to the variable name.

>

>---

>MaximumASP offers enhanced hosting solutions on the Windows 2000 platform. 

>Dedicated processor, RAM, and server resources provide dedicated server 

>performance at virtual server prices. Commercial components provided; 

>custom components allowed.






Message #20 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Thu, 25 Jan 2001 10:10:25 -0000
Do you mean if you're doing 



var sCol = "red"

richtextbox.selcolor = sCol



its trying to set the colour to "sCol" rather than red? Thats very wierd...





-----Original Message-----

From: O'Hara, Elliott M [mailto:EMOHARA@k...]

Sent: Wednesday, January 24, 2001 5:44 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





I changed the class id to a rich text box. Now I'm recoding the buttons that

I need to change the RTF formatting.



Do you know much JavaScript??

The font Color is killing me...

I'm passing the variable fine, but when I plug it into the

richtextbox.selcolor, its trying to set the color to the variable name.











Message #21 by "O'Hara, Elliott M" <EMOHARA@k...> on Thu, 25 Jan 2001 07:30:28 -0500
no... I thought that was what it was doing...

I was wrong..

SelColor wouldn't take a "red" or "green"

so I was sending it the hex number from the htm table that the button call

(JavaScript)

well, to get it to see hex, you have to add "0x" so I did this

varr = blah, blah

varr = "0x" + varr

then I got a "illigal value" (and a spelling error :)

Problem was that it was seeing it as a string (I had just manipulated it

like one)

sooo... what I did was make my own function (because I couldn't find one

that already exsited) that converted the hex to dec on the Color Table,

before it actually sent it back to the taskbar (so varr was dec)

seemed to work... except colors didn't match Red was blue.... vise versa...

Well, being that MS has to do thing different They go BGR, not RGB...

So FF0000 was actually blue to the RTF, but its Red to HTML. So more string

manipulation... but Its working now...

exciting enough for you???



-----Original Message-----

From: Alex Shiell, ITS, EC, SE [mailto:alex.shiell@s...]

Sent: Thursday, January 25, 2001 5:10 AM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





Do you mean if you're doing 



var sCol = "red"

richtextbox.selcolor = sCol



its trying to set the colour to "sCol" rather than red? Thats very wierd...





-----Original Message-----

From: O'Hara, Elliott M [mailto:EMOHARA@k...]

Sent: Wednesday, January 24, 2001 5:44 PM

To: ASP Web HowTo

Subject: [asp_web_howto] RE: Rich Text Box in a form





I changed the class id to a rich text box. Now I'm recoding the buttons that

I need to change the RTF formatting.



Do you know much JavaScript??

The font Color is killing me...

I'm passing the variable fine, but when I plug it into the

richtextbox.selcolor, its trying to set the color to the variable name.






  Return to Index