1
0
-1

I'd like to include pre marked up HTML content into a form as part of building a survey that is maintained by end users in a database.

I can query the database using Dynamic Data Services and get the HTML content, just need something to do the formatting in the form.

Any suggestions?

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Hi Jason,

      It depends a bit on what you're intending to do with the HTML content, but one approach for replacing field labels or rich text areas can be to:

      • Use a Data Field (or possibly a Phase Value) to hold the HTML content that you wish to inject
      • Use a Basic Push Button (or possibly a Business Rule (General)) script to update the target label / area with JQuery replace:
      var data = {markupData};
      $({richTextField}).html(data);

      where:

      {markupData} is a reference to the Data Field (type: Raw Value)

      {richTextField} is a reference (type: Node) to the form node to be updated

       

      Note that there are a couple of things to keep in mind with this:

      • be aware of possible side effects in your CSS styling with the HMTL being injected this way;
      • the Transaction Manager Form Submission Preprocessor service, which includes an XML-safe check, will not like embedded/encoded less-than (<, &lt;, etc.) characters appearing the in the submitted form data.

       

        CommentAdd your comment...