I am using Bootstrap 3 RC1. The Problem I am having is with the textarea — when the page loads it adds 3 spaces to the texarea, ultimately making the placeholder text invisible, unless I manually delete the spaces.
How do I stop this from happening?
HTML
<form id="noteSubmitForm">
<fieldset>
<textarea id="note-text" rows="6" placeholder="Add a note" class="form-control">
</textarea>
<div class="form group">
<button id="noteSubmitButton" type="submit" class="btn btn-success btn-custom">
Save Note
</button>
</div>
</fieldset>
</form>
CSS
textarea#note-text {
width: 625px !important;
}
How do I stop this from happening?
By not having whitespace between your textarea tags, as you have right now:
<textarea id="note-text" rows="6" placeholder="Add a note" …>
</textarea>
There’s a line break (first line break directly at the beginning gets ignored by browsers though), and then there are spaces before the closing tag, so those are part of the value content of your textarea as well, because that’s how the content of a textarea is written – between the opening and closing tag.
If you don’t want content there – don’t put content there:
<textarea …></textarea>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With