I have two input textareas, and the second one is hidden. Is it possible to automatically duplicate text typed in the first textarea to to the second?
So far I can think of 1) javascript, but not sure how to implement that. 2) do something with my forms in php:
$form['textarea1'] = array(
'#type' => 'textarea',
'#title' => 'title',
'#rows' => 20,
'#required' => TRUE,
);
and
$form['textarea2'] = array(
'#type' => 'hidden',
'#rows' => 20,
'#required' => TRUE,
'#default_value' => value from textarea 1?
);
btw, it's Drupal.
Thank you for any suggestions.
Update. The first form is being built by special module and it saves the data to it's own table instead of saving data to drupal system table (node_revisions). My module creates the second form to duplicate data to drupal system table.