Replace VbCrLf in TextArea

| Product: | UltraDev 4 |
|---|---|
| Server Model: | ASP VBScript |
|
This tutorial will show how to replace VbCrLf with <br>, so that the input of a textarea gets formatted for display. When making a insert or update in Ultradev/MX you just have to make a small insert to make this work. Find the code that is commented with 'create the sql insert statement' or 'create the sql update statement'. In this code find (Ultradev): Else FormVal = Replace(FormVal,vbCrLf,"<br>") If (i <> LBound(MM_fields)) Then In this code find (MX): Else MM_formVal = Replace(MM_formVal,vbCrLf,"<br>") If (MM_i <> LBound(MM_fields)) Then Insert the red marked replace command and the flat text in a textarea will formatted where the user has made a Return. This is very handy when using just a form to maintain for example a news admin-tool. That's it !
|
Marcellino Bommezijn
Marcellino Bommezijn is one of the managers at dmxzone.com. He is a contributor on the tutorials section.
Owner of Senzes Media (http://www.activecontent.nl) which provides professional services and web applications for mid-sized companies.
ActiveContent CMS is the ASP.NET Content Management solution that is used for building professional and rich-featured websites.
User Reviews
Total of 10 reviewsRE: RE: how to do the opposite?
Written by steve powell on February 7, 2005Remember that the Replace function has more arguments that will greatly simplify your code by allowing case INSensiTive searching strTmp1 = Replace(CStr(strHTM),'<br>', vbCrLf, 1,-1, 1)strTmp = Replace(strTmp1,'<tr>', vbCrLf, 1,-1, ...
RE: RE: RE: RE: how to do the opposite?
Written by hans grimm on June 27, 2003Yes! I have discovered the way to do it all serverside and show the formfield with the text already formatted: step 1: put the script above the <html>-tags, like this: <%function RemoveHTML(strHTM) dim strTmp, strTmp1, i, lngLen, ...
RE: RE: RE: how to do the opposite?
Written by Tim Bednar on March 17, 2003I figured it out. The VBScript does not work on the MAC because it is client side. So I use this instead... <%Dim strBodystrBody = rsEntry.Fields.Item('Body')%><textarea name='txtBody'><%=Replace ...
RE: RE: how to do the opposite?
Written by Tim Bednar on March 17, 2003This little trick works great for Win IE, but does not work on my Mac IE? Any suggestions?
Great little tutorial
Written by Ralf Fredriksson on December 17, 2002I´ve searched this place for this functon and couldn´t find it so I wrote in the MX forum and asked for this. No answers. But I found this tutorial by accident and it worked great. Thanks
RE: RE: RE: how to do the opposite?
Written by hans grimm on March 4, 2002one other little thing I found out: if you do not want all tags to be stripped (such as <b> or <a>, etc.), in the script, replace 'If charOne='<' Then' by 'If charOne='' Then', and 'If charOne = '>' Then' by 'If charOne = '' Then'. ...
RE: RE: how to do the opposite?
Written by hans grimm on February 13, 2002note: 'naam.TextArea' is to be replaced by the name of your textarea...
RE: how to do the opposite?
Written by hans grimm on February 13, 2002hello, I'm replying to my own post because I've found it! see below: this between <Head> </Head>:-----------------------------------------------------------------------<SCRIPT language='VBScript'><!--function RemoveHTML(strHTM) ...







