public $form_requirements = array(
'contact[f_name]' =>
array( 'friendly_name' => 'the contact\'s first name',
'required_if' => array('add_new_contact' => array('value' => 1, 'type' => 'textbox' )) ),
'contact[l_name]' =>
array( 'friendly_name' => 'the contact\'s last name',
'required_if' => array('add_new_contact' => array('value' => 1, 'type' => 'textbox' )) ),
'contact[address1]' =>
array( 'friendly_name' => 'the first line of the address',
'required_if' => array('add_new_contact' => array('value' => 1, 'type' => 'textbox' )) ),
'contact[city]' =>
array( 'friendly_name' => 'a city',
'required_if' => array('add_new_contact' => array('value' => 1, 'type' => 'textbox' )) ),
'contact[zip_code]' =>
array( 'friendly_name' => 'a zip code',
'required_if' => array('add_new_contact' => array('value' => 1, 'type' => 'textbox' )) ),
'call[datetime_date]' =>
array( 'friendly_name' => 'the call date',
'regexp' => '/\d{2}\/\d{2}\/\d{4}/' )
);
In my controller, I used a version of adding to multiple tables from one form to add both the contact and the call.
No comments:
Post a Comment