Glad to see you go it working, all looks kosher. The Email class will have populateTemplate() available to it in the next 2.3.0 release.
Cheers,
Sean
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
Glad to see you go it working, all looks kosher. The Email class will have populateTemplate() available to it in the next 2.3.0 release.
Cheers,
Sean
Liam mentioned something that I thought existed - a required class automatically added to all of the required fields in forms.
We've on 2.4.0 and I can't see the class anywhere in the HTML/CSS code or the DOM. Is there something I'm missing?
Cheers
Tama
In the end I applied the "requiredField" class (used by the custom User Forms module) with the following code:
// Set required fields in form object and assign classes
$requiredFieldList = array('FirstName','LastName','Email');
$validator = new RequiredFields($requiredFieldList);
foreach($requiredFieldList as $fieldName) {
$fields->fieldByName($fieldName)->addExtraClass("requiredField");
}
Thanks to this repo: http://sunny.svnrepository.com/sunny-side-up-general/trac.cgi/browser/userpage/code/RegisterAndEditDetailsPage.php?rev=73