Kevmon
Kevmon

Reputation: 1005

textarea is Filled with White Spaces

First off, I'm using Shopify. I have a textarea and it is filled with white spaces when the page loads. I know why, it's because of the HTML, but I don't know why the browser is served different HTML than the HTML I created.

Here is my code:

<textarea name="contact[body]" id="ContactFormMessage" placeholder="Your message...."></textarea>

And this is what is served to the browser:

<textarea rows="10"
    name="contact[body]"
    id="ContactFormMessage"
    placeholder="Your message">

</textarea>

Anyone know what's going on?

Upvotes: 2

Views: 2192

Answers (2)

Scott C Wilson
Scott C Wilson

Reputation: 20036

You have no value in your textarea block. If you wanted the textarea to be initialized with "foo", you would do

<textarea name="contact[body]" id="ContactFormMessage" placeholder="Your message">foo</textarea>

As an aside, the square brace is not a valid character for the name attribute. (See https://www.w3.org/TR/html401/types.html#h-6.2)

Upvotes: 1

Ramin Ahmadi
Ramin Ahmadi

Reputation: 629

you have empty space between beginning textarea tag and closing tag. you need to remove that.

<textarea rows="10"
    name="contact[body]"
    id="ContactFormMessage"
    placeholder="Your message"></textarea>

Upvotes: 3

Related Questions