1

i have one pageblocksection.enter image description here

i want to remove Required information displaying on right hand side. Thanks.

<apex:pageBlockSection columns="2" title="Personal Data"> <apex:pageBlockSection columns="1"> <apex:repeat value="{!Info}" var="application"> <apex:repeat value="{!Fields}" var="app"> <apex:inputField value="{!application[app.fieldPath]}" required=" {!OR(app.required, app.dbrequired)}"/> </apex:repeat> </apex:repeat> </apex:pageBlockSection> </apex:pageBlockSection> 
1
  • Can you please share your code of Visualforce? Commented Feb 20, 2013 at 11:24

3 Answers 3

3

You can do what @techtrekker was getting at by putting an id on the pageBlockSection and then changing the jQuery selector to use that in conjunction with the requiredLegend class (see below). However, anytime you rely on behind the scenes CSS you risk that SF will change it at some point making your page break. You might want to push back on the requirement a little with an explanation that the required information text is standard functionality.

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script type="text/javascript"> var $j = jQuery.noConflict(); $j(document).ready(function() { // note that there is a space before the .requiredLegend $j('[id$="myBlock"] .requiredLegend').hide(); }); </script> <apex:pageBlockSection columns="2" title="Personal Data" id="myBlock"> 
0
2

If you're referring to the the text that appears on a standard page layout, from View Source, it is a span with class=requiredText

You can hide it using jQuery

jQuery.noConflict(); jQuery('.requiredText').hide(); 

This would hide all elements where the class was requiredText

2
  • but i want to do this only on 1 pageblock section.rest i want the same. Commented Feb 20, 2013 at 11:33
  • If its the first occurrence, you can use the first jQuery selector api.jquery.com/first-selector Commented Feb 20, 2013 at 11:56
2

This is actually a much easier without any javascript code if you just change the mode parameter of apex:pageBlock from edit to detail, and then sets collapsible="false" for the pageBlockSection:

<apex:pageBlock mode="detail" tabStyle="account"> <apex:pageBlockSection columns="2" title="Personal Data" collapsible="false"> 


With mode="edit" :

enter image description here

And with mode="detail" :

enter image description here

1
  • 1
    That is much better if the whole page or pageBlock is using it and it is acceptable for an edit page to be styled like a detail page, but I think in this case he just wanted one of the pageBlockSections to change. Commented Feb 20, 2013 at 12:46

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.