Posted by Andrey Zakharov on November 28, 2012 at 8:11pm
Arghhhh
vanilla drupal 7.14 install, make simple module
<?php
function at_form_alter(&$form, &$form_state, $form_id) {
if ($form_id == 'page_node_form') {
$form['title']['#prefix'] = '<div id=address-wrapper>';
$form['title']['#suffix'] = '</div>';
$form['title']['#ajax'] = array(
'callback' => '_node_form_callback',
'wrapper' => 'address-wrapper',
);
}
}
function _node_form_callback($form, $state) {
return $form['title'];
}
?>what is expected: as title is required field, it should validated to red when you blur from empty title textfield. but
it didn't work:
- ajax works as expected
- on blur ajax performs, i can even make some messages and so on
- but no standart validation
what I'm doing wrong?