• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

textarea field causing issues when trying to decode json response

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • textarea field causing issues when trying to decode json response

    I have a form with a textarea field as follows:
    HTML Code:
    xtype: 'textareafield',
    anchor: '100%',
    fieldLabel: 'Label',
    hideLabel: true,
    name: 'complaint',
    fieldStyle: 'text-transform:uppercase',
    enforceMaxLength: true,
    maxLength: 500
    If a user presses "enter" in this field it seems to keep the *CRLF in the data on the back end.
    Why I think so is because, when I try to use vvOut_toJSONpair to send it back to the front end,
    Ext.decode crashes and says it's an invalid response.
    Not to mention, if you try to bring up the record using the good ole upddta command, it says it contains invalid data.

    Any suggestions on how to handle this?

  • #2
    it appears this did the trick but it sure is ugly..

    textareafield.replace(/(\r\n|\n|\r)/gm," ");

    Comment

    Working...
    X