Jump to:

2002 Posts in 1422 Topics by 616 members

Form Questions

SilverStripe Forums » Form Questions » Whats the Best way to store formatted text in a form?

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 938 Views
  • jdi
    Avatar
    Community Member
    34 Posts

    Whats the Best way to store formatted text in a form? Link to this post

    Hey Crew.

    I've been trying to store html formatted text from a form so that users entering a 'description' will have their text formatting saved on entry:

       public function SubmissionForm() {
          $fields = new FieldSet();

    $fields->push(new TextareaField('Description', 'Description'));

    $actions = new FieldSet();
          $actions->push(new FormAction('SubmissionFormAction', 'Submit'));

          return new Form($this, 'SubmissionForm', $fields, $actions);
    }

    In the back end of the CMS I can use HTMLEditorField without issue. But I don't want A: The user to be able to use a WYSIWYG editor and B: Know that their input is being saved as HTML text.

    Whats the best way to get this?

    A really good example is this Content field I'm filling out right now! hah.

  • jdi
    Avatar
    Community Member
    34 Posts

    Re: Whats the Best way to store formatted text in a form? Link to this post

    Is this something thats straight forward or is it a more complicated topic?

    938 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.