Change displayed field value after form submit

I have a custom form which creates nodes. The form is re-displayed with the original values after submission or if I include $form_state[‘rebuild’] = TRUE; the re-display has all the fields empty.

I want to be able to change the fields that are re-displayed – for example setting some to “” and leaving others at their previous value.

I have tried various options – some do nothing whereas others break the form.

Here is the code for the submit function:

function fe4_form_submit($form, &$form_state) {

global $user;

$values = array(
  'type' => 'prices',
  'uid' => $user->uid,
  'status' => 1,
  'comment' => 1,
  'promote' => 0,
);
$entity = entity_create('node', $values);
$ewrapper = entity_metadata_wrapper('node', $entity);
$ewrapper->title->set('My E Title');
$entity->field_product_name[LANGUAGE_NONE][0] = array('value' => $form_state['values']['product_name'] );
$entity->field_price[LANGUAGE_NONE][0] = array('value' => $form_state['values']['price'] );
$ewrapper->save(TRUE);
drupal_set_message( "Node with nid " . $ewrapper->getIdentifier() . " saved!n");

$newvalue = 9934.09;

//---none of these work 
//form_set_value($form['field_product_name'], array(0 => array('value' => $newvalue)), $form_state);
//$form_state['values']['price'] = $newvalue;
//$form['price'][#default_value] = $newvalue;
//$form['price'] = array ( 'value' => $newvalue);
//$form_state['values']['price'][LANGUAGE_NONE][0]['value'] = $newvalue;
//$form_state['values']['price'][0]['value'] = $newvalue;


//$form_state['rebuild']  = TRUE;

}



I am obviously missing something important in my understanding of the Form API. I hope someone can point out what it is ! Thanks.

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/4/feed