Losing empty line at beginning of textarea
-
I’m working on a widget, and I have a textarea where the admin can add captions to the slideshow, one caption per line. If he doesn’t want to add a caption to a certain image, he leaves the line empty.
This works great, as long as the first line contains a caption. If I want to leave the first line empty, then after saving the widget options in the widget admin panel, that first empty line disappears, and what I wrote on the second line now has become the first line.
I double checked my code, and I don’t do anything with the textarea content, so my guess is that WP somewhere in the process of saving the widget data in the DB eliminates the empty lines at the beginning. If I’m right, then is there a way of preventing this?
- The topic ‘Losing empty line at beginning of textarea’ is closed to new replies.