1

On SharePoint application page I am using placeholder in <input> like this:

<input type="text" id="name" name="name" placeholder="your name" />

But placeholder is underlined and says: Validation (XHTML 1.0 transitional) Attribute placeholder is not a valid attribute. But when i put runat = "server", error goes away

<input type="text" id="name" name="name" placeholder="your name" runat="server" /> 

Now, its valid attribute. I could not understand why placeholder attribute is not valid without runat = "server". Can anybody tell the reason? I did not want to use runat = "server".

I have also added <!DOCTYPE html>at top of the application page, but still it gives same error

SPBeginer
  • 733
  • 3
  • 14
  • 29

2 Answers2

2

You are using HTML5 markup, with XHTML 1.0 Transitional doctype

placeholder, article, footer, etc are all HTML5

<!DOCTYPE html>

Above is the appropriate DOCTYPE for HTML5.

Muhammad Talha Akbar
  • 9,952
  • 6
  • 38
  • 62
  • I am actually using SharePoint application page where i placed . Inside , i am using
    and I have put Before tag, but still placeholder attribute is not valid and is underlined. any idea ?
    – SPBeginer Jan 13 '13 at 11:21
  • no, i have no idea about asp.net, you added html5 as a question tag so that's why i was able to add answer :D but still i can search for you – Muhammad Talha Akbar Jan 13 '13 at 11:22
0

placeholder is a HTML5 attribute, Therefore it shouldn't be valid under xHTML 1.0 Transitional. As for the runat attribute changing the behavior, it's most likely a flaw in the system or just being suppressed for some reason.

Austin Brunkhorst
  • 20,704
  • 6
  • 47
  • 61