Appnitro Software Forums » MachForm

Upload text in html

(5 posts)
  • Started 1 year ago by rscott7706
  • Latest reply from rscott7706

  1. I searched for an answer on this, hope I am not asking something that has been answered before.

    On a text paragraph field...

    I would like some forms to upload the text to database with html tags. As it uploads now and populates the database, all tags are stripped out.

    So for instance:

    This is text.
    This is text.

    Becomes:
    This is text.This is text.

    What I would like to see is:
    This is text. This is text.

    Is there a work around for this?

    Thanks!!
    Ron

    Posted 1 year ago #
  2. Hi Ron,

    What HTML tag do you use ? I try with '<br>' , '<P>' tags it not stripped out. It give me same result with my paragraph text input.

    Posted 1 year ago #
  3. Hey redityo,

    I mislead you.

    What I meant to say was that when typed in to the form and submitted, hard returns don't show up in the database (so my reference to "html tags").

    Here is a sample:

    http://www.lakesideca.com/chamber/chamber_events/chamber_events.php

    When entering the text in Machform (Paragraph Text), I put:

    Test
    Hard return
    Test
    Hard Return

    It shows up on the website as:
    Test Hard return Test Hard Return

    I hope I was more clear this time.

    Ron

    Posted 1 year ago #
  4. Hi Ron,

    I try to figure it :) ... I hope my answer meet your expectation. Basically text area consider a white space as carriage returns and it will not rendered in HTML.
    However you can use nl2br() function to show the line break in HTML to your output. You can refer to this :

    http://www.plus2net.com/php_tutorial/line-breaks.php

    But if you consider to save "break" tags in database, you should edit your "post-functions.php" file, try to search around line 201. You will see this code :

    $table_data[$element_name] = $element_data;

    replace it with

    if ($form_id == 23 && $element_id == 2) {
    	$table_data[$element_name] = nl2br($element_data)	;
    } else {
    	$table_data[$element_name] = $element_data;
    }

    in there i assume your paragraph text in form 23 with element id = 2

    Posted 1 year ago #
  5. Top of the morning, redityo

    Works perfectly... Another support issue defined and dealt with!!

    Thanks for your prompt and professional help.

    Ron

    Posted 1 year ago #

RSS feed for this topic

Reply

You must log in to post.