CodeCharge Studio
search Register Login  

Visual Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 How to manage and format TEXTAREA fields

Print topic Send  topic

Author Message
Matteo Ferrari
Posted: 03/03/2002, 3:17 PM

Hi CodeChargers,
I have a problem with TEXTAREA fields and their formatting; I'm writing a
little page that should send a mail message; I need to print out the content
of TEXTAREA fields to an HTML page and mail the content as text body, in
both cases formatting properly the body of the message; I would need to
generate the form with <TEXTAREA WRAP=phisical> (which is not the default)
and, in the first case, if I need to print the content to an HTML page, I
need to translate all newline or carriage returns to <BR>; in the second
case I should transform those characters to \n.
Is it right, or am I missing something ??? How can I change the way
<TEXTAREA> commands are generated ?? the default is WRAP=OFF.
Do you have any suggestions ??
Thanks to all who will help me.....
Matteo Ferrari

Sam Brown
Posted: 03/07/2002, 12:24 AM

Matteo,
To display "memo" type fields entered by users in grid/record forms, I have
simply used something found in one of the examples in the Before Show event:

fldYourField = replace(fldYourField,vbCRLF,"<br>")

To send data output in Email: (I use JMail but CDONTS should be similar.)
I built an HTML table (to let me put the data fields in specific areas of
the table (essentially creating a report form), broke the table up
line-by-line, then used Msg.AppendHTML to add each "HTML code" line to the
email. Formatting, then, is a result of how you structured the HTML table.

When building the HTML table (outside of CC in HomeSite) I simply inserted
text into each cell that I could later identify (like PUT_NAME_FIELD HERE or
PUT_MEMO_FIELD_HERE) to make it easy after I pasted it into the After Insert
Event (or other based on what you are doing.
....
msg.ContentType = "text/html"
msg.HTMLBody="<html><head><title>REGISTRATION REQUEST</title></head><body>"
msg.AppendHTML "<table border=""1"" width=""100%"">"
msg.AppendHTML "<tr>"
msg.AppendHTML "<td width=""100%"" align=""center"" colspan=""5"">"
msg.AppendHTML "<p><font size=""5"">HAPPY TRAILS</font><br><font
size=""3"">EMAIL REGISTRATION REQUEST FORM</font></td>"
msg.AppendHTML "</tr>"
msg.AppendHTML "<tr>"
msg.AppendHTML "<td width=""400"">"
msg.AppendHTML "<p><font size=""1"">APPLICANT</font><br><b>" & fldpREGNAME
msg.AppendHTML "</b></td>"
msg.AppendHTML "<td width=""80"">"
msg.AppendHTML "<p><font size=""1"">AGE</font><br><b>" & fldpREGAGE
msg.AppendHTML "</b></td>"
.....
and so on...many of the appended lines could have been combined...I left it
like I see it in the web page just for easy correction, etc.

Works For Me
Sam Brown

"Matteo Ferrari" <m.ferrari@tiscalinet.it> wrote in message
news:a5uatn$17i$1@news.codecharge.com...
> I have a problem with TEXTAREA fields and their formatting; I'm writing a
little page that should send a mail message; I need to print out the content
of TEXTAREA fields to an HTML page and mail the content as text body, in
both cases formatting properly the body of the message; I would need to
generate the form with <TEXTAREA WRAP=phisical> (which is not the default)
and, in the first case, if I need to print the content to an HTML page, I
need to translate all newline or carriage returns to <BR>; in the second
case I should transform those characters to \n.

> Is it right, or am I missing something ??? How can I change the way
<TEXTAREA> commands are generated ?? the default is WRAP=OFF.
Do you have any suggestions ??


Matteo Ferrari
Posted: 03/08/2002, 1:05 AM

Sam,
thanks a lot; I translated your code in PHP and it works fine !!!

Matteo Ferrari

"Sam Brown" <sbrown6@rochester.rr.com> ha scritto nel messaggio
news:a6784h$qvg$1@news.codecharge.com...
> Matteo,
> To display "memo" type fields entered by users in grid/record forms, I
have
> simply used something found in one of the examples in the Before Show
event:
>
> fldYourField = replace(fldYourField,vbCRLF,"<br>")
>
> To send data output in Email: (I use JMail but CDONTS should be similar.)
> I built an HTML table (to let me put the data fields in specific areas of
> the table (essentially creating a report form), broke the table up
> line-by-line, then used Msg.AppendHTML to add each "HTML code" line to the
> email. Formatting, then, is a result of how you structured the HTML table.
>
> When building the HTML table (outside of CC in HomeSite) I simply inserted
> text into each cell that I could later identify (like PUT_NAME_FIELD HERE
or
> PUT_MEMO_FIELD_HERE) to make it easy after I pasted it into the After
Insert
> Event (or other based on what you are doing.
> ...
> msg.ContentType = "text/html"
> msg.HTMLBody="<html><head><title>REGISTRATION
REQUEST</title></head><body>"
> msg.AppendHTML "<table border=""1"" width=""100%"">"
> msg.AppendHTML "<tr>"
> msg.AppendHTML "<td width=""100%"" align=""center"" colspan=""5"">"
> msg.AppendHTML "<p><font size=""5"">HAPPY TRAILS</font><br><font
> size=""3"">EMAIL REGISTRATION REQUEST FORM</font></td>"
> msg.AppendHTML "</tr>"
> msg.AppendHTML "<tr>"
> msg.AppendHTML "<td width=""400"">"
> msg.AppendHTML "<p><font size=""1"">APPLICANT</font><br><b>" & fldpREGNAME
> msg.AppendHTML "</b></td>"
> msg.AppendHTML "<td width=""80"">"
> msg.AppendHTML "<p><font size=""1"">AGE</font><br><b>" & fldpREGAGE
> msg.AppendHTML "</b></td>"
> ....
> and so on...many of the appended lines could have been combined...I left
it
> like I see it in the web page just for easy correction, etc.
>
> Works For Me
> Sam Brown
>
> "Matteo Ferrari" <m.ferrari@tiscalinet.it> wrote in message
>news:a5uatn$17i$1@news.codecharge.com...
> > I have a problem with TEXTAREA fields and their formatting; I'm writing
a
> little page that should send a mail message; I need to print out the
content
> of TEXTAREA fields to an HTML page and mail the content as text body, in
> both cases formatting properly the body of the message; I would need to
> generate the form with <TEXTAREA WRAP=phisical> (which is not the default)
> and, in the first case, if I need to print the content to an HTML page, I
> need to translate all newline or carriage returns to <BR>; in the second
> case I should transform those characters to \n.
>
> > Is it right, or am I missing something ??? How can I change the way
> <TEXTAREA> commands are generated ?? the default is WRAP=OFF.
> Do you have any suggestions ??
>
>
>

Meir Kriheli
Posted: 03/11/2002, 12:26 AM

If you're using PHP you can use nl2br() function.
--
Meir Kriheli

Matteo Ferrari wrote:

> Sam,
> thanks a lot; I translated your code in PHP and it works fine !!!
>
> Matteo Ferrari
>
> "Sam Brown" <sbrown6@rochester.rr.com> ha scritto nel messaggio
>news:a6784h$qvg$1@news.codecharge.com...
>> Matteo,
>> To display "memo" type fields entered by users in grid/record forms, I
> have
>> simply used something found in one of the examples in the Before Show
> event:
>>
>> fldYourField = replace(fldYourField,vbCRLF,"<br>")
>>
>> To send data output in Email: (I use JMail but CDONTS should be similar.)
>> I built an HTML table (to let me put the data fields in specific areas of
>> the table (essentially creating a report form), broke the table up
>> line-by-line, then used Msg.AppendHTML to add each "HTML code" line to
>> the email. Formatting, then, is a result of how you structured the HTML
>> table.
>>
>> When building the HTML table (outside of CC in HomeSite) I simply
>> inserted text into each cell that I could later identify (like
>> PUT_NAME_FIELD HERE
> or
>> PUT_MEMO_FIELD_HERE) to make it easy after I pasted it into the After
> Insert
>> Event (or other based on what you are doing.
>> ...
>> msg.ContentType = "text/html"
>> msg.HTMLBody="<html><head><title>REGISTRATION
> REQUEST</title></head><body>"
>> msg.AppendHTML "<table border=""1"" width=""100%"">"
>> msg.AppendHTML "<tr>"
>> msg.AppendHTML "<td width=""100%"" align=""center"" colspan=""5"">"
>> msg.AppendHTML "<p><font size=""5"">HAPPY TRAILS</font><br><font
>> size=""3"">EMAIL REGISTRATION REQUEST FORM</font></td>"
>> msg.AppendHTML "</tr>"
>> msg.AppendHTML "<tr>"
>> msg.AppendHTML "<td width=""400"">"
>> msg.AppendHTML "<p><font size=""1"">APPLICANT</font><br><b>" &
>> fldpREGNAME msg.AppendHTML "</b></td>"
>> msg.AppendHTML "<td width=""80"">"
>> msg.AppendHTML "<p><font size=""1"">AGE</font><br><b>" & fldpREGAGE
>> msg.AppendHTML "</b></td>"
>> ....
>> and so on...many of the appended lines could have been combined...I left
> it
>> like I see it in the web page just for easy correction, etc.
>>
>> Works For Me
>> Sam Brown
>>
>> "Matteo Ferrari" <m.ferrari@tiscalinet.it> wrote in message
>>news:a5uatn$17i$1@news.codecharge.com...
>> > I have a problem with TEXTAREA fields and their formatting; I'm writing
> a
>> little page that should send a mail message; I need to print out the
> content
>> of TEXTAREA fields to an HTML page and mail the content as text body, in
>> both cases formatting properly the body of the message; I would need to
>> generate the form with <TEXTAREA WRAP=phisical> (which is not the
>> default) and, in the first case, if I need to print the content to an
>> HTML page, I need to translate all newline or carriage returns to <BR>;
>> in the second case I should transform those characters to \n.
>>
>> > Is it right, or am I missing something ??? How can I change the way
>> <TEXTAREA> commands are generated ?? the default is WRAP=OFF.
>> Do you have any suggestions ??
>>
>>
>>

   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

PHP Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.