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
InspiredInspired 

InputField - Custom Object - Change required attribute via javascript?

From documentation...

 

A Boolean value that specifies whether this inputField is a required Boolean
field. If set to true, the user must specify a value for this field. If not
required selected, this value defaults to false. Note that if this input field
displays a custom object name its value can be set to nil and will not
be required unless you set this attribute to true. The same does not
apply to standard.

 

Anyone done this via javascript? I would like to default to false and change to true via javascript.

Ispita_NavatarIspita_Navatar

This I think it(changing the required attribute of Visual Force Tag) cannot be achived via javascript.What perhaps you can do is use a flag in the page which you set and unset selectively to make the field behave like a required or not required field via javascript validations.

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved.