I need to pass an array with all the fields (with their values) from a form from the submit function to a rules_invoke_event.
to do this I'm calling a get_fields() function, in this function I have acces to the form and form_state objects. Just wondering how I could loop through one of these with a foreach to get an array with the pairs?
function get_fields($form, $form_state)
$fields = array()
foreach(element in form)
{
$fields[$element[key]] = element[value];
}
return$ fields
}
something like this but with correct syntax?
Help would be greatly appreciated :)