This is my ajax callback function
function myid_search_idnumber($form, $form_state)
{
return $form['id'];
}
It updates the values in $form['id']
. But Because I wanted to call a javascript function as well as update the form, I added a few codes:
function myid_search_idnumber($form, $form_state)
{
$commands[] = ajax_command_invoke(NULL, 'myid_update_id_number');
$page = array( '#type' => 'ajax', '#commands' => $commands, );
ajax_deliver($page);
return $form['id'];
}
The three lines of code added above, calls a javascript function.
$.fn.myid_update_id_number = function(){
alert('Wew');
}
Performing those only calls the javascript function but does not update anymore my form. How will I call my javascript and at the same time update my form?