Add a checked_array() to compare arrays like checked()
|Reported by:||sudar||Owned by:||nacin|
The checked() function checks whether two parameters passed to it are equal and then outputs checked='checked', which can be used in forms having checkboxes or radio buttons.
Sometimes (particularly for checkboxes), we might need to check for multiple values. So I am proposing a change to the checked() function.
It can first check whether the default value is an array and if yes, it can return checked='checked' if the current value is present in the default array.
I have attached a patch with this change.
Change History (16)
- Keywords reporter-feedback added; checked template removed
- Owner set to westi
- Status changed from new to accepted
- Keywords reporter-feedback removed
- Summary changed from Ability to compare arrays in checked() function to Add a checked_array() to compare arrays like checked()
comment:11 nacin — 3 years ago
- Milestone changed from Awaiting Triage to Future Release
- Owner changed from westi to nacin
comment:12 westi — 3 years ago
- Milestone Future Release deleted
- Resolution set to wontfix
- Status changed from accepted to closed