You must set 'False' for Html escaping for that field in Studio.
Then you can simply use html tag <PRE>**field**</PRE>

Or You can use that simple function In OnBeforeDisplay method for field:

CSpDisplayField df=(CSpDisplayField)event.getSouce();
df.setValue(
        new CSpString(ReformatText( df.getValue().toString() )));

public static String ReformatText(String inTxt){
                String result = "";
                String sreplace="";
                int freplace=0;
                int index = 0;
                int startIndex = 0;
                int len =inTxt.length();
                int spcCounter = 0;
                int plcCounter = 0;
                char ch='0';
                while(index < len){
                        ch = inTxt.charAt(index);
                        freplace=0;
                        switch(ch){
                        case '<':
                                sreplace="&lt;"; freplace=1;
                        break;
                        case '>':
                                sreplace="&gt;"; freplace=1;
                        break;
                        case '&':
                                sreplace="&amp;"; freplace=1;
                        break;
                        case '"':
                                sreplace="&quot;"; freplace=1;
                        break;
                        case '\r':
                                sreplace="\r<BR>"; freplace=1;
                        break;
                        case ' ':
                                ++spcCounter;
                                ++plcCounter;
                        break;
                        case '\t':
                                spcCounter += 4;
                                ++plcCounter;
                        break;
                        default:
                                if(spcCounter > 1){
                                        if(index - plcCounter > startIndex) result += 
inTxt.substring(startIndex, index - plcCounter);
                                        while(spcCounter > 1){
                                                result += "&nbsp;";
                                                --spcCounter;
                                                }
                                        result += " ";
                                        startIndex = index;
                                        }
                                plcCounter = spcCounter = 0;
                        break;
                        }
                        if (freplace != 0) {
                                if( index > startIndex) result += 
inTxt.substring(startIndex, index);
                                result += sreplace;
                                startIndex = index+1;
                                plcCounter = spcCounter = 0;
                        }
                        ++index;
                }
                if(index > startIndex) result += inTxt.substring(startIndex, index);
                return result;
        }


"Pauline Chui" <[EMAIL PROTECTED]> wrote:
>
>Hi,
>
>I have a textbox field on an Edit page and after the user clicked on Update, another
>page shows up and this field would be shown in Static Text.
>
>However, if the users have carriage returns in their text box, it will be 
>automatically
>concatenated.  For example, in the text box:
>123<CR>
>456<CR>
>789<CR>
>This would show up in the Static Text: 
>123 456 789
> 
>Is there anyway to work around this problem?  All your help is greatly appreciated!
>
>Have a great day!
>Pauline


_________________________________________________________________________
To unsubscribe from this mailing list please send an email to:
[EMAIL PROTECTED]
Please remember to use the same email address you subscribed with.

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

Reply via email to