Ive created a textfield with an ajax callback with 'keyup' event.
In need the callback function to be fired only after a certain number of character ... I can control the number of character of the input in the callback function, but this is not the way I want it...
There's maybe a javascript way to avoid the callback to be fired before 5 character ?
My form field :
$form['myitem'] = array(
'#type' => 'textfield',
'#size' => 6,
'#maxlength' => 5,
'#default_value' => '',
'#name' => "my_name",
'#disabled' => FALSE ,
'#ajax' => array(
'callback' => 'mymodule_mycallback_ajax_callback',
'wrapper' => "mywrapper",
'method' => 'replace',
'event' => 'keyup',
'progress' => array('message' => NULL),
),
);