How to access field values from an entity reference field in a custom module?
$form['card_on_file' ] = array(
  '#type' =&gt; 'entityreference',
  '#title' =&gt; t ('Credit Card'),
  '#era_entity_type' =&gt; 'node', // Mandatory 
  '#era_bundles' =&gt; array(credit_card ), // Optional (Any bundle by default).
  '#era_cardinality' =&gt; 5, // Optional (1 By default).
  '#required' =&gt; TRUE,
) ;


the warning corresponds to this replace this code:

'#era_bundles' =&gt; array(credit_card ), // Optional (Any bundle by default).


with

'#era_bundles' =&gt; array('credit_card'),


Link: https://api.drupal.org/api/drupal/includes!common.inc/function/entity_load/7

$ids = array();


get $ids from $form_state['values'] of submit handler function.

use entity_load('credit_card', $ids);