How can set a custom action with a custom attribute selected in form? I have a view of persons. I like to add the persons to an event. I also like to set the status of the resulting relation to one of the values &quot;optional&quot; or &quot;required&quot;.
Therefore I use VBO on a list of persons. With the submitted NIDs I like to build a relation from the person to the event and fill the relation data field &quot;status&quot; with the selected value from the from.
To create only the relation it was easy to create a new action with custom php code, which builds my relations programmatically.
To add a parameter to the relation I have to edit the view's form programmatically. So I hook into the form alter of the views form and add a custom dropdown with the two values &quot;optional&quot; or &quot;required&quot;.
The questions are:

Is it possible to use the selected dropdown value in the vbo action with custom php code? I only know how to handle the selected nid's. This option would be easier for me to implement.
If 1) is not possible: Should I use a custom submit function for the vbo form? And where to assign the function?

I tried the following code to assign a custom submit custom_webform_pre_build_list_vbo_submitfunction but it isn't called.
function custom_webform_pre_build_list_form_alter(&amp;$form, &amp;$form_state, $form_id) {
    if ($form_id == &quot;views_form_person_list_panel_pane_9&quot; 
    and $form['#id']=='views-form-person-list-panel-pane-9') {
        $form['#submit'] = array('custom_webform_pre_build_list_vbo_submit'); 
    }
}
It is possible to use the $_POST array in the custom php code, which can be called in the action, which is assigned to the vbo action!
The page to show the view with the vbo fields is: /node/%node/add_person_to_event, so arg(1) is the nid of the event.

So my custom action code is:

$status = $_POST['status'];
$event = arg(1);
foreach ($_POST['views_bulk_operations'] as $key-&gt;$vbo_nid) {
   build_relation_person_event($event, $vbo_nid, $status);
}