function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Shiv ShankarShiv Shankar 

How to use HTML 5 attribute with <apex:inputText />

Hello friends,

 

I want to add a html 5 attribute (Ex : - placeholder="First name") with <apex:inputText />. Is there any way to add html 5 attribute with <apex:inputText />.

 

I do not want to go manipulation using jQuery OR JavaScript , If we have essy solution for it.

 

I Tried below approch but it's not working.

 

<apex:page doctype="html-5.0" controller="RequestWizardController" sidebar="false" showHeader="false" >
     <apex:form>
            <apex:repeat value="idToItemRequest" var="rec">
                   <apex:inputText html-placeholder="First name" value="{! idToItemRequest[rec].Sample__c}" />
            </apex:repeat>
     </apex:form>
</apex:page>

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard
Custom HTML attributes are only supported for apex:outputpanel tags at the moment I'm afraid.

All Answers

bob_buzzardbob_buzzard
Custom HTML attributes are only supported for apex:outputpanel tags at the moment I'm afraid.
This was selected as the best answer
up_skyup_sky

In Winter ’14 do this (w/ html5 doctype):

 

<apex:inputText html-placeholder="your placeholder"