Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Form Questions /

Validation for Custom Form


Go to End
Reply


11 Posts   6910 Views

Avatar
Sean

Forum Moderator, 922 Posts

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

Avatar
Tama

Community Member, 132 Posts

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

Avatar
Tama

Community Member, 132 Posts

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

Go to Top