how to add to search form some js functions

złanowina - December 3, 2008 - 08:05

i'd like to add to search form some js functions and change the default value. how should i do it?

original code:

the code i need:

i found the function resposible for that

function search_box(&$form_state, $form_id)
http://api.drupal.org/api/function/search_box/6

the question is how to change this function without changing drupal code or how to add some elements to #attributes array

ups, i ate the sample code

złanowina - December 3, 2008 - 08:07

ups, i ate the sample code ;]

<input type="text" maxlength="128" name="search_block_form" id="edit-search-block-form-1" size="15" value="" class="form-text" />

the code i need:
<input type="text" maxlength="128" name="search_block_form" id="edit-search-block-form-1" size="15" value="" onClick="javascript:somefunction();" class="form-text" />

 
 

Drupal is a registered trademark of Dries Buytaert.