I am calling a function whenever someone press enter in the textarea. Now I want to disable new line or break when ent
For Angular Users
While there are existing working solutions, if anyone comes across this question using Angular, you can disable new lines with the following:
Add
In your controller, add:
$scope.$watch('your.model', function(newvalue, oldvalue) {
if (newvalue && newvalue.indexOf('\n') > -1) {
$scope.your.model = oldvalue;
}
});