Hi Guys,
I am not getting understand where I am doing wrong. I have created a function that creates a form with the 'og' module.
function test_form_invitation($cat_arr, $gid){
$form['#id'] = 'test_form_'.$cat_arr;
//$form['#id'] = 'og_invite_form';
$form['newsite_invitation'] = array(
'#type' => 'fieldset',
'#title' => t('Invite others to your site?'),
'#weight' => 3,
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'#prefix' => '<div class="node-form">',
'#suffix' => '</div>',
);
if(module_exists('og')){
$form['newsite_invitation'] = array_merge($form['newsite_invitation'], og_invite_form($gid));
}
if(module_exists('og_reg_codes')){
$code = og_reg_codes_get_code($gid);
$form['newsite_invitation']['pmessage']['#default_value'] .= strtr(_og_reg_codes_message(), array('%reg_code' => $code)). "\n\n";
}
return $form;
} // end of function test_form_invitation
This creates the complete and accurate form, I have also used the validation function as...in the 'OG' module, just call the function from 'OG' module and passing the parameters.
function test_form_invitation_validate($form_id, $form_values, $form){
og_invite_form_validate($form_id, $form_values, $form);
} // end of function test_form_invitation_validate
I have also used the submit function from the 'OG' module as.........in the 'OG' module
function test_form_invitation_submit($form_id, $form_values){
og_invite_form_submit($form_id, $form_values);
} // end of function test_form_invitation_submit
If I use the OG module like 'og/invite/xxx' then the form submits the accurate values but when I use the form in my new module as above then it gives me result message as '0 invitations sent.'. Either I give one or two email IDs in the textarea.
I think the form_set_value() is not working well.........what do you think
Please help me to get rid of this problem and what is wrong with this code.....
Thanks
CRINCH