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
Stephen E 4Stephen E 4 

Visualforce page jumps to a text box on load (lightning)

Hello,

We have a button on cases that load up a visualforce page and prompts the user to enter information. There are text boxes, radio buttons, check boxes, etc. When the page loads, the page jumps down to the first text box, causing the user to have to scroll back up to enter the checkbox/radio button information. This only seems to happen in lightning. How can we stop this from happening?
Best Answer chosen by Stephen E 4
Khan AnasKhan Anas (Salesforce Developers) 
Hi Stephen,

Greetings to you!

Try this: Add the below piece of code in your visualforce page. 
 
<apex:page>
    <script>
        function setFocusOnLoad() {}
    </script>

    <!-- further content -->
</apex:page>

I hope it helps you.

Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

Thanks and Regards,
Khan Anas