I am looking to control some input on a textarea field. I want to be able to let users hit return twice, to start a new paragraph or line with a whitespace between it, but no more than that. I have seen some regex that can removes multiple new lines (2 or more) but like I said I want users to be able to space their text of if they want.
Is anyone familiar with some code that can remove new lines when there are 3 or more in a row, but leave 1 and 2 alone?
Question
Nimec
Fellow Neowiners,
I am looking to control some input on a textarea field. I want to be able to let users hit return twice, to start a new paragraph or line with a whitespace between it, but no more than that. I have seen some regex that can removes multiple new lines (2 or more) but like I said I want users to be able to space their text of if they want.
Is anyone familiar with some code that can remove new lines when there are 3 or more in a row, but leave 1 and 2 alone?
Cheers.
Link to comment
Share on other sites
1 answer to this question
Recommended Posts