Hi i have a textfield form with attribute of "data-updated" the default is 0 If user clicks on textfield and fill it, "data-updated" changes to 1 with jQuery. On form submit the attribute remains 0 even if it changed to 1, how can i fix it?
Here is the code:
$form['name'] = array(
'#title' => t('Name'),
'#type' => 'textfield',
'#attributes' => array('data-updated' => 0, 'onclick' => array('jQuery(this).attr("data-updated", 1);')),
);
And here is the submit
print_r($form_state['complete form']['name']['#attributes']['data-updated']);
die();
I always get 0 even if the jQuery update the attribute to 1 :/