skip to Main Content

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?

2

Answers


  1. 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>
    Login or Signup to reply.
  2. 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)

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search