Check to see if field is required

Wonder95's picture
Offline
Joined: 02/20/2008
Juice: 283
Check to see if field is required

At the time the page is displayed, you know whether or not a field is set as required (you can query the db in your form function). What I would do is to check the required status of the field if it is a radio button set; if it is required, select the default (by passing the value to the #default_value form control in the form function), and if it isn't required, don't pass it.