Am using drupal 5.7

i created the custom events display,

in that i added the search event ,

for that search , i written the validation ,

I include the JS file,...
in the top of the search form,

But no use...

drupal_add_js("event_search.js")
strSearch = "";
    for(i=0;i<arrSearch.length;i++){
        strSearch+=arrSearch[i]+"+";
    }
    if(strSearch!=""){
        strSearch = strSearch.substr(0,(strSearch.length-1));
        //alert(strSearch);
    }
 window.location.href="/site1/?q=search/node/event/"+strSearch; return false;}</script>';
 $block['content'].= '<form action="/site1/?q=search/node/event" name="frm_search_event"  accept-charset="UTF-8" method="post" id="search-form" class="search-form"  onsubmit="return event_search_validation();">';
 $block['content'].= '<div><div class="form-item">';

 $block['content'].= '<div class="container-inline" style="margin-right:100px;"><div class="form-item">';
 $block['content'].= '<input type="text" maxlength="255" name="keys" id="edit-keys" name="txt_search_event"  size="25" value="" class="form-text"/>';
 $block['content'].= '</div>';
 $block['content'].= '<input type="image" src="files/images/btn-search-events.jpg" align="middle" width="96" height="21 name="ops" id="edit-submits" value="Events Search"  class="form-submit" onClick="javascript:return goToEventSearch();" />';
 $block['content'].= '</div>';
 $block['content'].= '</div>';
 $block['content'].= '<input type="hidden" name="form_token" id="edit-search-form-form-token" value="29ae915e9bd7e3eb6d8a484b7095fed5"  />';
 $block['content'].= '<input type="hidden" name="form_id" id="edit-search-form" value="search_form"  />';
 $block['content'].= '</div></form>';

Thanks u

 




On Fri, Aug 1, 2008 at 11:56 AM, <rolf@openusource.com> wrote:
Hi,

That's the way to do it!

>From which file do you call drupal_add_js? Make sure that the PHP file is
part of your running installation.

Which version of drupal are you using?

Regards,
Rolfington

> Hi
>
>
> How to include the JS file ,
>
> I tried drupal_add_js ,
>
> but file not included
>
> Any idea
> --
> [ Drupal support list | http://lists.drupal.org/ ]


--
[ Drupal support list | http://lists.drupal.org/ ]