1

I wanted to enable a textarea to submit on enter.

                <script>
                    $('#wire_post').keydown(function (e) {
                    var keyCode = e.keyCode || e.which;                         
                    if (keyCode == 13) {
                    $(this).parents('form').submit();
                    return false;
                    }
                    });
                </script>

Unfortunately I cannot do a shift+enter using the above code, as the enter is captured and the form submits. How do I allow shift+enter to CR to the next line in the text area while keeping the originally intended functionality?

0 Answers0