ASP-Based Webmail: Include Original Reply Formatting
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS ASP > ASP-Based Webmail: Include Original Reply Formatting




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    ASP-Based Webmail: Include Original Reply Formatting  
JStrummer


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-27-04 11:17 PM

I'm building an ASP-based CRM system; a user sees the original
message, posted from the database and can hit a Reply button to
generate a TEXTAREA field on the next page that houses the original
messages and allows them to type a reply and hit a "Send" button.

The original message from the database includes natural line breaks,
as submitted--it doesn't contain any HTML breaks.

I would like to accomplish two things:

1) Add a "> " before each line of the original message, as contained
in the reply

2) In conjunction with the "> " preceding each line, break the
original messge string into logical line lengths that fit inside the
textarea field and don't wrap

Any help would be appreciated.





[ Post a follow-up to this message ]



    Re: ASP-Based Webmail: Include Original Reply Formatting  
Coz


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-27-04 11:17 PM

might be a faster way, but you could loop and break the string up..in this
example, into 75 char lines:

x=0
str=""
Do while x<=len(str)
str=str & ">" &  Mid (str, x, x+75) & vbCrLf
x=x+75
Loop


"JStrummer" <google-usenet@jstrummer.e4ward.com> wrote in message
news:137012e7.0408271027.25a55f2b@posting.google.com...
> I'm building an ASP-based CRM system; a user sees the original
> message, posted from the database and can hit a Reply button to
> generate a TEXTAREA field on the next page that houses the original
> messages and allows them to type a reply and hit a "Send" button.
>
> The original message from the database includes natural line breaks,
> as submitted--it doesn't contain any HTML breaks.
>
> I would like to accomplish two things:
>
> 1) Add a "> " before each line of the original message, as contained
> in the reply
>
> 2) In conjunction with the "> " preceding each line, break the
> original messge string into logical line lengths that fit inside the
> textarea field and don't wrap
>
> Any help would be appreciated.







[ Post a follow-up to this message ]



    Re: ASP-Based Webmail: Include Original Reply Formatting  
Evertjan.


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
08-27-04 11:17 PM

Coz wrote on 27 aug 2004 in microsoft.public.inetserver.asp.general:

> might be a faster way, but you could loop and break the string up..in
> this example, into 75 char lines:
>
> x=0
> str=""
> Do while x<=len(str)
>   str=str & ">" &  Mid (str, x, x+75) & vbCrLf
>   x=x+75
> Loop

Not very nice to break the words.

Using jscript, try this:

s += ' '
s = s.replace(/(.{1,70}) /g,"> $1\n")

or vbscript :

Set regEx = New RegExp
regEx.Pattern = "(.{1,70}) "
regEx.Global = True
s = regEx.Replace(s&" ","> $1" & vbCrLf)


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress,
but let us keep the discussions in the newsgroup)






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:40 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum 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
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register