We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 45634
    • 23 Posts
    I've put a textarea field in a CMP update & create box.

    Some trunacted code:

    Whisky.window.CreateBrand = function(config) {
        config = config || {};
        Ext.applyIf(config,{
            title: _('whisky.brand_create')
            ,url: Whisky.config.connectorUrl
            ,baseParams: {
                action: 'mgr/brand/create'
            }
            ,fields: [{
                xtype: 'textarea'
                ,fieldLabel: _('whisky.brand_history')
                ,name: 'history'
                ,anchor: '100%'
            },{.....


    The box appears with a multi line text box correctly.

    But when user presses Enter it saves the data, not adds a new line.

    If the user copies and pastes text with a newline in, it saves fine.

    How can I get Enter to make a new line and not save?

    Thanks,

    This question has been answered by romain. See the first response.

    • discuss.answer
      • 33976 ☆ A M B ☆
      • 571 Posts
      Hi,

      Assuming your window extends the MODx.Window class, this might be relevant.

      Override the
      keys
      attribute by setting it to an empty array (ie.
      keys: []


      Hope this will help
        • 45634
        • 23 Posts
        Brilliant, thanks!