1779 Posts in 582 Topics by 556 members
| Go to End | ||
| Author | Topic: | 5778 Views |
-
Re: Validation for Custom Form

16 January 2009 at 9:35am
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 -
Re: Validation for Custom Form

30 September 2010 at 10:43am
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 -
Re: Validation for Custom Form

1 October 2010 at 3:37pm
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
| 5778 Views | ||
| Go to Top |


