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
hisrinuhisrinu 

How to set foucs on part of visualforce page.

Hi,

Can we set focus to particular part of screen while page loading.
Any pointer on this highly appreciatable.

Thanks
Srini
visulaforcevisulaforce
u can use apex:actionFunction tag to set the focus to any element  of page. like this code
 
<apex:page tabStyle="Account">
    <apex:form>
        <!-- Define the JavaScript function setFocus-->
        <apex:actionFunction name="setFocus" focus="click"
        rerender="out" />
        <apex:outputtext>Name:</apex:outputtext>
        <apex:inputText id="testId1"></apex:inputText><br></br><br></br>
        <apex:commandButton id="click" value="Click Me"></apex:commandButton>
    </apex:form>
    <apex:outputPanel id="out">   
    </apex:outputPanel>
<script language="javascript">
    <body onload="setFocus()">
</script>
</apex:page>

 
hisrinuhisrinu
Hi,


Thanks for your help.