You need to sign in to do that
Don't have an account?
Inspired
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.
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.