function hostingService_example_basic::validate in Hosting 7.4
Same name and namespace in other branches
- 6.2 example/hosting_example.service.inc \hostingService_example_basic::validate()
- 7.3 example/example_service/hosting_example.service.inc \hostingService_example_basic::validate()
Validate a form submission.
Overrides hostingService::validate
File
- example/example_service/ hosting_example.service.inc, line 137 
- Example service implementation for the hosting front end.
Class
- hostingService_example_basic
- An implementation of the example service type, registered with hook_hosting_service.
Code
function validate(&$node, &$form, &$form_state) {
  // REMEMBER TO CALL THE PARENT!
  parent::validate($node, $form, $form_state);
  if (sizeof($this->example_field) > 30) {
    form_set_error('example_field', t("The example string must not be longer than 30 characters"));
  }
}