Take the 2-minute tour ×
Salesforce Stack Exchange is a question and answer site for Salesforce administrators, implementation experts, developers and anybody in-between. It's 100% free, no registration required.

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>
share|improve this question
    
Can you please share your code of Visualforce? –  Mohith Shrivastava Feb 20 '13 at 11:24
add comment

3 Answers 3

up vote 3 down vote accepted

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">
share|improve this answer
    
thanks @peter knolle –  Pankaj Feb 20 '13 at 12:04
add comment

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

share|improve this answer
    
but i want to do this only on 1 pageblock section.rest i want the same. –  Pankaj Feb 20 '13 at 11:33
    
If its the first occurrence, you can use the first jQuery selector api.jquery.com/first-selector –  techtrekker Feb 20 '13 at 11:56
    
thanks techtrekker –  Pankaj Feb 20 '13 at 12:02
add comment

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

share|improve this answer
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. –  Peter Knolle Feb 20 '13 at 12:46
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.