Prevent Elementor Multi-Step Form textarea to change automatically to the next step

Viewed 494

I´m using the multi-step form from Elementor Pro. There is a little bug. If I have a textarea as single step, the textarea does not allow line breaks. If I press the ENTER key, it moves automatically to the next step. This is not a good practice for a textarea.

So I need a workaround for this because the project goes online next week.

$("textarea").on( "keydown", function(event) {
    if(event.which == 13) {
        event.preventDefault();
        $('textarea').val($('textarea').val()+'\n');
        return false;
    }
});

With the code above I create manually a new line and after this I return the function. This works in desktop devices, but not on mobile..

Do you have a better solution for this?

1 Answers

Beside of an extension that may work for you, there is another solution as follow:

  • Give the form an id in the Additional Options section (for example form_main).

  • Insert a HTML element on the page and add the following code in an script tag.

      jQuery(document).ready(function(){
          jQuery("#form_main").off('keydown');
      })
    

add script in html element

Related