Unset required fields in PRD
i created a prd which give the user a selection (RadioButtons) to choose a action which should be performed.
Choosing one of the selections, the fields for this action will be displayed.
* Add User or * Delete User
Selecting Add User: Username*, Location, Initial Password*
Selecting Delete User: DNLookup*, Reason
In both "sub-forms" i set fields to required. If i select "Add User", click on Submit i got the info "Username: field is required. Please specify a value.". Switching now to "Delete User", the info of the "Add User" field requirement still keeps up.
Is there any idea how to "reset" the form, remove the field requirement or h
Re: Unset required fields in PRD
In an on-change event tied to the radio button, get the current state of the button ("add" or "delete").
If current state is "add", then use set-required() to set the "add" fields to required, and the "delete" fields to not-required. You might also want to use hide() to remove the "delete" fields from the visible form.
Else, the current state is "delete", so set the "add" fields to not required and hidden, and the "delete" fields to required and visible.