I've got this code:
$form = Fieldset::factory('solution_main_update');
$languages = Model_Language::find('all');
foreach($languages as $language)
{
if(isset($solution_name[$language->language_code]))
{
$text = $solution_name[$language->language_code];
}
else
{
$text = '';
}
$form->add('name_'.$language->language_code, 'Name in '.$language->language_name, array('value' => $text), array(array('required')));
}
$form->add('submit', '', array('type' => 'submit', 'value' => 'Submit'));
$data = $form->build(Uri::create('/admin/solutions/update/'.$id.'/main'));
I think that should have 'required' set on each of the input boxes. Only question is, how do I do something like:
if($val->run())
{
//Validation requirements have been met. Do something cool.
}
Thanks!