Styling text

Is it possible to have multiple styles of text within one
Text Box? So far it seems that if I try to make a word in a line
bold, it makes the whole line bold.
I can understand that FLEX wasn't really meant to carry loads
of copy like a website but I just wanted to know if I can style
text without making separate text areas for every word I want
highlighted or bolded...etc

Its pretty sad how there is very little community support
here on these forums. Most topics on this forum have ZERO replies.
I would think that Adobe would have its flex developers support the
community on these forums so we can learn how to best use its
various products.

Similar Messages

  • Please Help.JTable insert styled text

    Hi all java guru,
    on post http://forum.java.sun.com/thread.jsp?forum=57&thread=485469 i've depicted my scenario in which i have a JTable where i want to add styled text.
    i've implemented a CustomTableModel that maintains information about text style, in such way that when renderer cell, i can rebuild exact text with its style....same method is adopted for CellEditor.
    It is possible to have more than one JTable in my application....then to correctly handle all JTables ' put them in a vector and during editing and rendering i find current focusable/selected JTable and edit/render it.
    Clearly i maintain information about style of text when i insert it, that is when i insert text, i update my CustomTableModel...same thing must be done when i delete text from JTable...that is, i must update CustomTableModel too in this case.
    Because my CellEditor is a JEditorPane component (extend it) i've registered document associated to it to a DocumentListener that notify every time that a remove operation is happens.
    What is the problem now???problem is that when i finish to edit a cell and click on another cell i've got a removeUpdate(DocumenEvent e) event, and i can't distinguish it.....it seems a real remove event....
    In this case(when i change cell) the code that is executes returns wrong result and invalidate all the rest.
    I think error is where i register celleditor , now i do it in CustomCellRenderer class that extend JEditorPane and implements TableCellRenderer.
    Please help me...this is a great trouble that invalidate all my work :(
    Any new idea is welcome.
    regards,
    anti-shock

    Hi stanislav, of course i can...you're a myth :)
    public class CustomCellEditor extends AbstractCellEditor implements TableCellEditor {
           CellEditor cellArea;
         JTable table;
         public CustomCellEditor(JTable ta) {
              super();
              table = ta;
              // this component relies on having this renderer for the String class
              MultiLineCellRenderer renderer = new MultiLineCellRenderer();
              table.setDefaultRenderer(String.class,renderer);
         public Object getCellEditorValue() {
              return cellArea.getText();
         public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected,     int row, int column) {
              int start = 0;
              int end = 0;
                                               // Get current selected table
              TableEditor tb = (TableEditor) TableEditor.getSelectedTable();
              TableModel model = (TableModel) tb.getModel();
              Vector fontInfo = model.getFontFor(row,column);
              CellEditor cellArea = (CellEditor) ((CustomCellEditor)tb.getCellEditor (row,column)).getCellEditor();
              Document doc = cellArea.getDocument();
              String content = tb.getValueAt(row,column).toString();     
              if (doc!=null && fontInfo.size()>0 && !content.equals("")) {
                                                     // This method reads from model and get right style info
                                                     // for current text, and restore them
                                                     restoreFontWithAttributes(doc,fontInfo,content);
              else
                   cellArea.setText(tb.getValueAt(row,column).toString());
              cellArea.rowEditing = row;
              cellArea.columnEditing = column;
              cellArea.lastPreferredHeight = cellArea.getPreferredSize().height;
              return cellArea;
          * @return
         public CellEditor getCellEditor() {
              return cellArea;
         public class CellEditor extends JEditorPane {
              private CellStyledEditorKit k;
              public CellEditor() {
                    super("text/plain","");
                    k = new CellStyledEditorKit();
                    setEditorKit(k);
                    // I tried to add document here, but i have had wrong behavior
                   doc = new DocumentListener() {
                   public void removeUpdate(DocumentEvent e) {
                      // Get current selected table
                      TableEditor tb = (TableEditor) TableEditor.getSelectedTable();
                      TableModel model = (TableModel) tb.getModel();
                      model.updateFontInfo();
                   getDocument().addDocumentListener(doc);
    }Ok, stan...this is my CustomCellRenderer class....as i have already said, i have some style text info mainteined by CustomTableModel associated with JTable.
    I update CustomTableModel every time that an insert and remove operation happens.
    If i add a DocumentListener to CellEditor (that rapresents editor cell of my table) happens that, if i remove some character from an editing cell, i got a removeUpdate event.....and this is right!!! But if i change cell (e.g. supposing editing cell(1,1), click on cell(2,1) then stop edit cell(1,1) and start edit cell(2,1)) i got a removeUpdate event, that I don't wait for to me..
    Look at this:
    empty cell | some text
    cell 0 ------- cell1
    supposing you're in cell1 and you have finished to insert "some text".Then click on cell0, that is empty....then document associated with CellArea(extend JEditorPane) before of the click on cell0 had some text, but after click have no text, then for it a removeUpdate is happens.....and is that one i got..
    it's as if an unique document is associated to all cells, while should be one document for each cell (i hope this is right).
    Clearly, i've same code for renderer, in such way that i can restore style of text on rendering.
    Hope is clear....if U have any idea or suggestion please give to me.
    Tnx a lot Stanislav..
    regards,
    anti-shock

  • How can I copy and paste (styled) text in JTextPane/JEditorPane?

    I have a styled text in my editor and I use the copy and the paste action in JTextPane, but i am not able to paste again with previous text formatting(it inserts same text, but with logical attributes - formatting at caret/inserted/ position)
    I use RTFEditor kit.
    Is it possible to put information about styled text into clipboard and paste it back? Shall I simulate clipboard somehow?
    Please help
    Thanks for any suggestion
    Vity

    This [url http://forum.java.sun.com/thread.jsp?forum=57&thread=197091]thread contains a discussion on this topic with a few suggestions. I haven't tried them so I don't know how they work. I found the thread by searching the forum with the keywords "+copy +style +jtextpane".

  • How to show $ sign alongwith the value in message styled text field.

    Hi,
    How to show $ sign alongwith the value in message styled text field.
    The value is coming from the table column in VO.
    I am working on OAF R12.

    Hi,
    Resolved.
    I used the below code in CO for the solution.
    Formatter currencyFormatter = new OADecimalValidater("$#,##0.00;($#,##0.00)",
    "$#,##0.00;($#,##0.00)");
    OAMessageStyledTextBean msrpField = (OAMessageStyledTextBean)webBean.findChildRecursive("MSRP11");
    msrpField.setAttributeValue(ON_SUBMIT_VALIDATER_ATTR, currencyFormatter);

  • Styled Text in Table Cell

    Hi,
    I've got this problem: I'd like to insert a styled text in some cells of a JTable.
    The text should be composed of two kinds of Font, to emphasize some characters in it.
    Suppose I've done a class Test, that extends JPanel. In this class I've done a method appendChar(String c, boolean bol). With this method I can add a JLabel with only a single char (String of length 1) at a time. If bol is true, it emphasizes the char; if false, it uses the "default" font. For example:
    "this is an example"
    This class works fine, but I don't have any idea on how I could be able to insert a Test instance in a JTable cell.
    I think I should create a class that implements TableCellEditor, or extends DefaultCellEditor.. but I don't know how this should be done.
    If there is some other way to have some styled text in a table cell, tell me!

    Hi,
    AFAIK, the default renderer for a table cell is a JLabel in which you can display styled text using html. You would need to provide a custom editor only if the default textfield doesn't fulfil your needs. For rendering, you need to override the renderer.
    Cheers,
    vidyut

  • AWT only canvas - styled text, images, word wrap and url posting.. how???

    Wassup people!
    Ive created a java chat client which uses the JTextPane to post messeges, emoticons and styled text. But the main problem here is that the majority of web browsers only support awt. Telling the users to download the latest jre with swing is long and most would rather go to another site, so i have reprogrammed the whole client in awt apart from the textpane. I now face the problem of creating a canvas that supports styled text, images, word wrap and url posting.
    I am only a beginner in java and the initial client was quite easy to do using swing, but to program an efficient canvas that supports this has proved to be quite challenging. would anyone beable to show me the best way of doing this? or refer me onto a library that already supports this? or is there even an awt version of the JTextPane somewhere which would save alot of time? any help would be most appreciated.
    Thanks

    I've seen a few APIs that are 100% pure java in 1.1 that implement a styled text area. They aren't free though and I'm pretty sure someone made some money off of the fact that java 1.1 didn't implement a styled text area.
    I understand the problem you are having. Before the days of swing styled text was something you wished you had. Just so you know, there is no easy way of doing this. You could always paint it yourself with a canvas in a scroll pane but then you get to the point where, unless you did some serious mouse handling, highlighting text becomes very difficult.

  • Print dynamic styled text with a GUI

    I need to write styled text in a computer and to receive and view it in another.
    But I don't know how to get this styled text: is it possible to get an xml (or html) format of the content of a TextArea (or other text box) and on the other computer to parse the .xml (or .html) and print it in a graphics Area for example (I would also like the text to fit in the area shape but it's another story!)
    could you help me?

    Although I don't know how to use them, I believe the JTextPane class can help you out. There's another thread around here somewhere that is somewhat similar to this one. Check out the docs for it.
    Jason

  • What is the right stream for reading a styled text ?

    I'm trying to write a code for a text processing program..
    It has to have functions to save the document and reopen it...
    how ever I'm trying to find the right stream to deal with the styled text.
    I'll appretiate any help and would be greatful if some piece of code was attached as an example.

    There was a tutorial somewhere on how to write an rtf editor. It basiocally used a jeditorpane, filled it with rtf data and saved the files. RTF is plain text (7bit ascii), like html, but the code is harder to read and nearly impossible to edit manually.
    here is helloworld.rtf:{\rtf1\ansi\deff0\deftab720{\fonttbl{\f0\fswiss MS Sans Serif;}{\f1\froman\fcharset2 Symbol;}{\f2\fswiss\fprq2\fcharset238 Arial;}{\f3\froman Times New Roman;}{\f4\fswiss\fprq2 Arial;}}
    {\colortbl\red0\green0\blue0;}
    \deflang2057\pard\plain\f4\fs20 Hello, World!\plain\f3\fs20
    \par }of course, all this is done in the background and all you have to see is the word-like document on screen.
    dave.

  • Styling Text in Flex???

    Hey there,
    What is your recommended way of styling text?  And how would you store user-defined styles and apply them to different parts of text (like "header1", "highlighted", etc.)?  Would you have to go through and use a text editor, or have you found a simple solution where you can just say “styleName” or “id” = “myStyle”, and it would apply styles from either a TextLayoutFormat object, or from some CSS parsed into a TextLayoutFormat object. Right now I am manually parsing CSS into TLF objects, caching them in a Dictionary, looping through Elements with “getChildByID”, and for-loop-assigning the TLF properties to the element. Seems like there could be something easier.
    Thanks a lot,
    Lance

    TextFlow supports the styleName and id properties IFormatResolver interface for this purpose.  Take a look at this blog entry.
    http://blogs.adobe.com/tlf/2009/02/iformatresolver-and-using-css-1.html
    It's not up-to-date with API revisions but all the constructs are still there.
    The examples zip has a SImpleEditorWIthCSS example as well.  See:
    http://download.macromedia.com/pub/opensource/tlf/textlayout_examples_072409.zip
    Richard

  • Styled Text in JClient

    Hi
    My clients needed browse and edit styled text (or RTF) and store content in database.
    Site java.sun.com presents many primers text editors with RTF, HTML, styled content.
    But as save this into database?
    Default binding JTextPane to ClobDomain store only text, without styles, images and others elements of the styled text :-(
    Please help!

    Hi,
    AFAIK, the default renderer for a table cell is a JLabel in which you can display styled text using html. You would need to provide a custom editor only if the default textfield doesn't fulfil your needs. For rendering, you need to override the renderer.
    Cheers,
    vidyut

  • Strange behaviour when scaling GREP styled text.

    In the quest for the perfect scaling script I am running into another problem. I tried to scale my GREP styled text, and it came out like this:
    Notice the "$" and "cents" are too small - whereas it should look like this:
    Sorry I used a slightly larger image and different value, but I don't that is an issue with respect to this problem.
    So on the desktop, I decide to check preference>general tab> when scaling> "apply to content" was checked.
    I changed it to "adjust scaling percentage" and my $249.99 came out perfectly proportional to the original set text, (let pretend there is a 2 in front of the $49.99)
    So I upload the template to the server and proceed to scale it and I get this:
    In this example, the decimal has not scaled and thus allowing the "cents" to jam into the dolllar value. I am also unable to reproduce this error on the desktop.
    Can anyone explain what is happening or how to compensate for these errors? Thanks for your help! My script is below:
    function myTransform(myPage, myRectangle, myScaleMatrix)
         app.transformPreferences.whenScaling = WhenScalingOptions.APPLY_TO_CONTENT;
        var everything;
        var origin;
        if ( ssize > 1.0 )
           //origin = myPage.resolve(AnchorPoint.CENTER_ANCHOR,CoordinateSpaces.PASTEBOARD_COORDINATES)[0];
           origin = myPage.resolve(AnchorPoint.CENTER_ANCHOR,CoordinateSpaces.PASTEBOARD_COORDINATES);
            myPage.transform(CoordinateSpaces.PASTEBOARD_COORDINATES,origin,myScaleMatrix);
            everything = myRectangle.everyItem();
            //origin = myPage.resolve(AnchorPoint.CENTER_ANCHOR,CoordinateSpaces.PASTEBOARD_COORDINATES)[0];
            everything.transform(CoordinateSpaces.PASTEBOARD_COORDINATES,origin,myScaleMatrix);
        else
            everything = myRectangle.everyItem();
            origin = myPage.resolve(AnchorPoint.CENTER_ANCHOR,CoordinateSpaces.PASTEBOARD_COORDINATES)[0];
            everything.transform(CoordinateSpaces.PASTEBOARD_COORDINATES,origin,myScaleMatrix);
            myPage.transform(CoordinateSpaces.PASTEBOARD_COORDINATES,origin,myScaleMatrix);

    var myDocument = app.documents.item(0);
    var myPages = myDocument.pages;
    var myRectangle = myDocument.pages.item(0).pageItems;
    var ssize = 2;
    //Scale a page around its center point.
    var myScaleMatrix = app.transformationMatrices.add({horizontalScaleFactor:ssize,  verticalScaleFactor:ssize});
    var idx;
    for(idx = 0; idx < app.documents.item(0).pages.length; idx++)
        myTransform(myPages.item(idx), myDocument.pages.item(idx).pageItems, myScaleMatrix);
    // if you want to export a pdf, uncomment
    //myPDFExport ();
    function myTransform(myPage, myRectangle, myScaleMatrix)
         app.transformPreferences.whenScaling = WhenScalingOptions.APPLY_TO_CONTENT;
        var everything;
        var origin;
        if ( ssize > 1.0 )
           //origin = myPage.resolve(AnchorPoint.CENTER_ANCHOR,CoordinateSpaces.PASTEBOARD_COORDINATES)[0];
           origin = myPage.resolve(AnchorPoint.CENTER_ANCHOR,CoordinateSpaces.PASTEBOARD_COORDINATES);
            myPage.transform(CoordinateSpaces.PASTEBOARD_COORDINATES,origin,myScaleMatrix);
            everything = myRectangle.everyItem();
            //origin = myPage.resolve(AnchorPoint.CENTER_ANCHOR,CoordinateSpaces.PASTEBOARD_COORDINATES)[0];
            everything.transform(CoordinateSpaces.PASTEBOARD_COORDINATES,origin,myScaleMatrix);
        else
            everything = myRectangle.everyItem();
            origin = myPage.resolve(AnchorPoint.CENTER_ANCHOR,CoordinateSpaces.PASTEBOARD_COORDINATES)[0];
            everything.transform(CoordinateSpaces.PASTEBOARD_COORDINATES,origin,myScaleMatrix);
            myPage.transform(CoordinateSpaces.PASTEBOARD_COORDINATES,origin,myScaleMatrix);
    function myPDFExport()
            //Basic PDF output options.
            pageRange = PageRange.allPages;
            acrobatCompatibility = AcrobatCompatibility.acrobat8;
            exportGuidesAndGrids = false;
            exportLayers = false;
            exportNonPrintingObjects = false;
            exportReaderSpreads = false;
            generateThumbnails = false;
            try
                ignoreSpreadOverrides = false;
            catch(e) {}
            includeBookmarks = false;
            includeHyperlinks = false;
            includeICCProfiles = true;
            includeSlugWithPDF = true;
            includeStructure = false;
            interactiveElementsOption = InteractiveElementsOptions.doNotInclude;
            //Setting subsetFontsBelow to zero disallows font subsetting;
            //set subsetFontsBelow to some other value to use font subsetting.
            subsetFontsBelow = 0;
            //Bitmap compression/sampling/quality options.
            colorBitmapCompression = BitmapCompression.none;
            //colorBitmapQuality = CompressionQuality.eightBit;
            colorBitmapSampling = Sampling.none;
            //thresholdToCompressColor is not needed in this example.
            //colorBitmapSamplingDPI is not needed when colorBitmapSampling
            //is set to none.
            grayscaleBitmapCompression = BitmapCompression.none;
            //grayscaleBitmapQuality = CompressionQuality.eightBit;
            grayscaleBitmapSampling = Sampling.none;
            //thresholdToCompressGray is not needed in this example.
            //grayscaleBitmapSamplingDPI is not needed when grayscaleBitmapSampling
            //is set to none.
            monochromeBitmapCompression = BitmapCompression.none;
            monochromeBitmapSampling = Sampling.none;
            //thresholdToCompressMonochrome is not needed in this example.
            //monochromeBitmapSamplingDPI is not needed when
            //monochromeBitmapSampling is set to none.
            //Other compression options.
            compressionType = PDFCompressionType.compressNone;
            compressTextAndLineArt = true;
            cropImagesToFrames = true;
            optimizePDF = true;
            //Printers marks and prepress options.
            //Get the bleed amounts from the document's bleed.
    //~         bleedBottom = myDocument.documentPreferences.documentBleedBottomOffset;
    //~         bleedTop = myDocument.documentPreferences.documentBleedTopOffset;
    //~         bleedInside = myDocument.documentPreferences.documentBleedInsideOrLeftOffset;
    //~         bleedOutside = myDocument.documentPreferences.documentBleedOutsideOrRightOffset;
    //~         //If any bleed area is greater than zero, then export the bleed marks.
    //~         if(bleedBottom == 0 && bleedTop == 0 && bleedInside == 0 && bleedOutside == 0)
    //~         {
    //~             bleedMarks = true;
    //~         }
    //~         else
    //~        {
    //~             bleedMarks = false;
    //~        }
    //~        colorBars = false;
            colorTileSize = 128;
            grayTileSize = 128;
            cropMarks = false;
            omitBitmaps = false;
            omitEPS = false;
            omitPDF = false;
            pageInformationMarks = false;
            pdfColorSpace = PDFColorSpace.unchangedColorSpace;
            //Default mark type.
            pdfMarkType = 1147563124;
            printerMarkWeight = PDFMarkWeight.p125pt;
            registrationMarks = false;
            try
                simulateOverprint = false;
            catch(e) {}
            useDocumentBleedWithPDF = false;
            viewPDF = false;
        //Now export the document.
        var thisDocument = app.documents.item(app.documents.length-1);
        var fullname = app.scriptArgs.getValue("OutputFileName");
        var idx = fullname.indexOf("_");
        var shortname = fullname.substring(0, idx);
        //thisDocument.exportFile(ExportFormat.pdfType, app.scriptArgs.getValue("OutputFolder") + shortname + ".pdf");
        thisDocument.exportFile(ExportFormat.pdfType, "c:\boosttest.pdf");

  • Lov and Message Styled Text Problem in OAF R12

    Hi,
    I am trying to develop a UI page for capturing country information in OAF R12.
    I am facing an issue as described below:
    I am choosing the Country Name for a Lov and the Country Code should get populated automatically into the field as below
    Country Name Country Code Status Flag
    India (Lov) IN (populated from Lov) Active (msg choice)
    Add New Row --- Button Apply -- Button
    Now country Name : Message Lov
    Country Code : Message styled Text
    Now when I click on the Add New Row button, the value in the Country code field gets
    disappeared.If I click on Apply button, value does not get saved to the db.
    But if I make Country Code as : Message Text Input, then the value remains, whether I click on the Add New Row or the Apply button and value gets saved to db.
    Is there a workaround for this. Also I am working on OAF R12. Does this kind of thing occur even in OAF 11.5.10 ?
    Kindly help its very urgent.
    Thanks

    Hi,
    You have to take care of these things...
    1. Return the value from LOV to a form value on a page. Now attach a view instance and view attribute to this form value say VO1 and Attr1 respectively.
    2. Now attach the same VO instance and vo attribute to the Messagestyletext/messagetextinput u are using for the CODE.
    This will surely retain the values and will save to DB too.

  • I lost Message Styled Text bean - please help me to find it

    Hello fellows,
    within /oracle/apps/fnd/wf/worklist/webui/NotifDetailsRG page i created new "Message Styled Text"with ID= “xxitMyTestTxt01”
    with default property "Rendered" = false. Also i created controler which on processRequest should set this message styled text rendered true.
    Could you please share the code which finds this text bean within current page? Meanwhile i've experienced some difficulties in doing this.
    Thank you in advance.

    maharadza ,
    I think all of us Shiv, Tapash and me have repeated this in couple of threads in recent past, that forum is a place where you should put ur quieies,when u don't find solution in none of the available sources:
    1)Dev Guide
    2)Old threads in this forum.
    Ur query is very generic, and i think u will many threads where this is been dealt.We are here to help but not teach basics.
    Instead of telling others to keep silent and making strange remarks,I think you should follow the same.I have seen threads where Shiv has helped people in threads which go beyond 3-4 pages, even when the user is asking very basics.
    So, Replying threads is no piece of cake, people replying here manage to take out time from there regular job to help others..... which they are not bound to...(sometimes, even try the same scenario themselves to help the others), so, just try to reply only 10 threads on any tech for 1 week, u would know that.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Perform Save for Styled Text and images

    I have build a text editor
    I am using a JTextPane
    but facing a problem with saving and opening the files with Styled text and images.
    Can any body help me out with a sample code
    Thank you

    Hi,
    If you want to save the file so that only your application can read the contents back, then you can serialize the Document of the JTextPane to the file and then read it back. This is the simplest approach.
    Serialize myTextPane.getDocument(); and while opening do
    Deserialize Document
    StyledDocument myDocument = stream.readObject();
    myTextPane.setDocument(myDocument);
    and you are done, irrespective of whether text pane contains only text or images or any other combination.
    Regards,
    [email protected]

  • Styling text box of a combobox

    Hi --
    I have a comboBox that I am styling using this code:
    new_style.setStyle("embedFonts",true);
    new_style.setStyle("fontFamily", "Gibraltar-Plain");
    new_style.setStyle("color", 0x653a71);
    new_style.setStyle("fontSize", 12);
    new_style.setStyle("rollOverColor", 0x653a71);
    new_style.setStyle("textRollOverColor", 0x000000);
    new_style.setStyle("selectionColor", 0xDDDDDD);
    new_style.setStyle("textSelectedColor", 0x000000);
    forminputs_mc.states_cbx.setStyle("styleName","cbxStyle")
    When I click on the drop down I see the items in the combo
    box but whenever
    I select an item the item shown in the combo box is empty. If
    I change the
    font to a non-embedded font it works fine. How do I set the
    "textField" to
    have the embedded font so it displays properly?
    Thanks
    Rich

    This is a screenshot of what text boxes affect the page title.
    If you can't change the necessary text box to reflect the title you want you can add the title via an HTML snippet and the following code:
    <script type='text/javascript'>
    parent.document.title = "PAGE NAME TO SHOW IN BROWSER TAB/BAR";
    </script>
    Apply the code via snippet to each page you want to change the name to.
    OT

  • Styling text submitted to a CMS

    Hi
    I am designing a website with CMS for a local church.
    Could anyone help me with controlling the appearance of text
    submitted to the database using the record insert wizard. My
    primary problem is that any text submitted to the database does not
    display in the website with paragraph breaks intact.
    I can think of 2 solutions. The first would be to include
    wysiwyg editor - I do not want to do this as I do not want the end
    user to have any control of any other aspects of appearance just as
    bold, italic etc. The 2nd would be to instruct my customer to
    include the <p> at the end of the para - I don't want to do
    this because I think it makes the CMS look a lot less polished and
    because my customer is a 60 year old lady who is already very
    frightened of computers, I think having to write code would push
    her over the edge.
    Can anyone suggest a way that para breaks are included
    without user intervention
    Thanks

    jeffoirecoupe1234 wrote:
    > I am building it myself.
    >
    > It is my first cms so I am probably doing something
    really basic wrong.
    >
    > The database is very simple, there is more than one
    table but none of them are
    > relational.
    >
    > Each page has one its own database table containing 3
    fields, a header, a
    > subheader and some bodycopy.
    >
    > The pages retrieve the info using a dreamweaver
    recordset.
    >
    > I have a separate page for uploading info to the
    database. Just a simple form
    > with 3 fields.
    >
    > Everything is working perfectly. The form pages accept
    the info and it
    > displays on the website - so I think I have understood
    everything and done it
    > correctly - except for the para breaks
    >
    >
    >
    >
    try this:
    <?php
    function nl2html($text) {
    $pattern = array('#\r\n?#', '#\n\n+#', '#\n#');
    $replace = array("\n", '</p><p>', '<br>');
    $ftext= preg_replace($pattern, $replace, $text);
    return $ftext;
    ?>
    <div id="mainContent">
    <h1 class="newsheadline"><?php echo
    $row_rsBeliefs['beliefsHeader'];
    ?></h1>
    <p class="newssubhead"><?php echo
    $row_rsBeliefs['beliefsSubheader'];
    ?></p>
    <p><?php
    $ftext=nl2html($row_rsBeliefs['beliefsBodycopy']); echo $ftext;
    ?></p>
    </div>
    Note that this code implies that you do not temper with the
    texteare outup but store is raw to the
    database.
    If this does not work, please post your code again
    seb (@webtrans1.com)
    high-end web design:
    http://webtrans1.com
    an ingenious website builder:
    http://sitelander.com
    music:
    http://myspace.com/popmodelberlin

Maybe you are looking for

  • UPgraded to Lion and can now longer access all my Entourage Contacts and Mail. What do I do. Desperate

    All my mail , contacts can no longer be opened as Entourage is a PPC app. What do I do to recover contacts and migrate to Apple mail. Would really appreciate help. Very important to me

  • Dynamically Rendering and editing JTable cell

    Hi all, I wonder if some body can help me. As in my application each cell in Jtable returns java Object. and what i am trying to do is based on each object returned in cell my renderer is going to change dynamically. for example if the object returne

  • Can't get my ring tones back still

    Why after the new iOS update I still cannot retrieve my ring tone it says that my device was not affected and I went from a 4s to a 6 and I still can't get them back

  • Display in functions tools

    I've imported drivers from Labwindows to LabVIEW tools panel, when now I open the tools panel and it display the folder of the drivers rather then display the icons as normal if I pressed on the pin to nail the tools panel, another way it displays as

  • Solaris 10 (6/06 SPARC) - Network install

    Hello all :) I downloaded the newest ISO, burned it. and tryed to execute the setup_install_server. it tries to find Boot directory (its linked to Boot -> ../../../s1) but the link is broken. in the X86 installation the link exists and not broken so