This time I explore a small but useful code, Some time we have validate the input text boxes using Jave Script or using required attribute but we didn't mark as Required field like a Salesforce required field red mark -
Using this code you can mark any <apex:inputText /> , <apex:inputField/> , <apex:inputTextarea/> , <apex:selectCheckboxes> , <apex:selectList> ....etc.
I have written a code for only <apex:inputText />
<apex:page>
<apex:form>
<Apex:pageBlock>
<Apex:pageBlockSection>
<Apex:pageBlockSectionItem>
Field Label <!-----Enter here field label ------>
<apex:outputPanel >
<div class="requiredInput">
<div class="requiredBlock"></div>
<!---- APEX / HTML Tag which you marked a required------>
<apex:inputText required="true" id="reqField" />
</div>
</apex:outputPanel>
</Apex:pageBlockSectionItem>
</Apex:pageBlockSection>
</Apex:pageBlock>
</apex:form>
</apex:page>
Using this code you can mark any <apex:inputText /> , <apex:inputField/> , <apex:inputTextarea/> , <apex:selectCheckboxes> , <apex:selectList> ....etc.
I have written a code for only <apex:inputText />
<apex:page>
<apex:form>
<Apex:pageBlock>
<Apex:pageBlockSection>
<Apex:pageBlockSectionItem>
Field Label <!-----Enter here field label ------>
<apex:outputPanel >
<div class="requiredInput">
<div class="requiredBlock"></div>
<!---- APEX / HTML Tag which you marked a required------>
<apex:inputText required="true" id="reqField" />
</div>
</apex:outputPanel>
</Apex:pageBlockSectionItem>
</Apex:pageBlockSection>
</Apex:pageBlock>
</apex:form>
</apex:page>
Gr8
ReplyDeleteThank You Sir
ReplyDeleteGreat work!
ReplyDeleteThank You Sir
DeleteNice Code.
ReplyDeleteThanks bro !!!
Deletevery helpful !!!!
ReplyDeleteNice work Raj! it will helps our team to do better........
ReplyDeleteThank you!!!
DeleteGood Idea and very Good..
ReplyDelete