I am building a custom module. In my module I have a form function which basically creates the form.
When this form is submitted, I want the form to return to a specific URL.
I have added a 'RET' hidden field to the form with the correct URL, but I am unsure how to have the form actual use this. Can anyone show me what I need to add to my existing code to achieve this.
public function form()
{
$entry_id = $this->EE->TMPL->fetch_param('entry_id');
if( $entry_id === FALSE ) {
return "";
}
$return = $this->EE->TMPL->fetch_param('return');
$hidden_fields = array(
"entry_id" => $entry_id,
"ACT" => $this->EE->functions->fetch_action_id( 'Cdwd_waiting_list', 'submit_record' ),
"RET" => $return
);
$form_data = array(
"id" => $this->EE->TMPL->form_id,
"class" => $this->EE->TMPL->form_class,
"hidden_fields" => $hidden_fields
);
$tagdata = $this->EE->TMPL->tagdata;
$form = $this->EE->functions->form_declaration($form_data) .
$tagdata . "</form>";
return $form;
}