1 Reply Latest reply on Mar 4, 2014 4:30 AM by ljcollazos

    line breaks disappearing in a inputTextArea ajax submit

    ljcollazos

      I have a form and one of the fields is a inputTextArea.
      Clicking on a a4j: commandButton form fields to pass some hidden fields for later use.
      If textArea contains line breaks to pass the value to the hidden field you do not appear, and I need to display a PDF document.


      I have seen with firebug in the ajax response not appear:


      Post:

      formCiudadano:expone  one line

                                         two line

      Response:

      <input id="expone" type="hidden" name="expone" value="one line two line"/>

      I use RichFaces 3.3.4 on JBoss EAP 5.2
      Is it a configuration problem?
      Do I have to replace the '\ n' by other characters?

      Regards

        • 1. Re: line breaks disappearing in a inputTextArea ajax submit
          ljcollazos

          I found a solution but not if it will be the best way to do it.

          Instead of using hidden input I use a "hidden" textarea for fields that can have line breaks:

           

          <textarea name="expone" id="expone" style="display:none;"> <h:outputText value="#{solicitudCiudadanoQYSBean.expone}"/> </ textarea>

           

          So the format is maintained and these fields display correctly in my PDF document.