Ticket #2486 (new enhancement)
automatically add a class to the fields in a form that are required
| Reported by: | nicolaas | Assigned to: | sminnee |
|---|---|---|---|
| Type: | enhancement | Priority: | medium |
| Milestone: | Component: | Sapphire Framework | |
| Version: | 2.2.2-rc2 | Severity: | medium effort / impact |
| Keywords: | Cc: | ||
| Due date: | Harvest Task: | (Unknown) | |
| Invoice sent to client: | 0 | Hours: |
Description
most of the time, when you have fields in a form, you want to highlight which ones are required. Would it be possible to add a class to the holder of each required field?
I tried to do this:
foreach($requiredFieldsArr as $fieldName) {
$newField = $fields->dataFieldByName($fieldName); $newField->setRightTitle("*"); $fields->replaceField($fieldName, $newField);
}
dataFieldByName as well as fieldByName do not actually return the right fields as stated in the documentation.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
