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
Nitish Singh 22Nitish Singh 22 

how to make apex:from on vf page read only

I have an apex form  <apex:form id="productSelectionForm">

I want to dynamically set this to readonly  maybe on window.onload event or something .

Any suggestions would be appreciated
FearNoneFearNone
you can't set apex:form to read-only.
you have to do it on every field. you can write a script for this
<script>
       function setReadOnly(){
                    document.getElementById('Page:Form:Block:Sec:field.id').readOnly=true;
        }
       window.onload = setReadOnly;
</script>

loop every field.id and set it to readonly.