Reputation:
I have a working text area that autoresize height according to input using JS function, I tried to add JS function to disable ENTER behavior adding new line but didn`t work.
<textarea id="title" name="title" class="autosize" placeholder="new post title" cols="42" rows="1">Post title</textarea>
http://jsfiddle.net/ihabovich/kepjdgnL/
Upvotes: 1
Views: 58
Reputation: 1590
Are you using internet explorer perhaps. It seems to work fine in the three browsers I was able to test in (Safari, Chrome and FF)
If you are using IE then have a look at this solution. event.preventDefault() function not working in IE
Upvotes: 1