3

I know someone here can help me out. I've looked at all the forums here on the same topic, but maybe someone can help my specific case. The placeholder isn't showing up for my textarea. Here is the code:

<fieldset class="contactFormDetails">
    <input type="text" name="input-name" placeholder="Name" />
    <input type="text" name="input-mail" placeholder="Subject" />
</fieldset>
<fieldset class="contactFormMessage">
    <textarea name="input-message" placeholder="Type your message here"></textarea>
</fieldset>
<fieldset class="contactFormButtons">
    <input type="submit" value="Send" />
</fieldset>
Tia Dame
  • 31
  • 1
  • 2

2 Answers2

2

What browser are you using? The placeholder attribute isn't supported in older versions of IE.

Have a look here to see if it is supported in your browser version: http://caniuse.com/input-placeholder

Have a look here: https://stackoverflow.com/a/13281620/1846192 for a jQuery plugin which adds support for the placeholder text in older IE versions, and which doesn't submit the placeholder text as a value when you submit your form.

Community
  • 1
  • 1
Mathijs Flietstra
  • 12,900
  • 3
  • 38
  • 67
1

You realize you can do this right?

<textarea name="input-message" placeholder="Type your message here"></textarea>
Matt Lambert
  • 3,655
  • 2
  • 24
  • 17
  • This isnt equivalent to placeholder text. Your solution requires a user to highlight and delete the text before entering their own, whereas placeholder text automatically disappears the moment you start typing into the textarea. Also, this solution involves more work when posting the form because the value "Type your message here" will be submitted if the user doesnt enter anything, which then needs to be handled on the server. – beterthanlife Oct 20 '14 at 09:52
  • @betterthanlife the original markup is correct then, check your css to see if it's hiding it or perhaps set to white? – Matt Lambert Oct 20 '14 at 21:54