[support] Normal search box form is send only there is #type => submit

Davide Michel 'ZioBudda' Morelli michel at ziobudda.net
Thu May 29 23:32:17 UTC 2008


Hi all. I have the standard search  form . I have (via hook_form_alter) 
unset the $form['submit'] button and I have insert this

            //unset($form['submit']);
            $form['search_block_form_keys']['#size'] = 18;
            $form['sumbit2'] = array(
                '#value' => '>>',
                '#prefix' => '<div class="submit"><a 
onclick="submitSearch();return false;" href="#">',
                '#suffix' => '</a></div>',
            );
            
            drupal_add_js("
            function submitSearch() { 
document.getElementById('search-block-form').submit();
            return false; }
            ","inline");
            break;

I have thinked that this worked (when click on the A TAG my 
"submitSearch()" function is call)  but it si not true. The only way to 
make this works is to remove the //  before  unset()  [first line of my 
code]

Why this ?

-- 
Michel 'ZioBudda' Morelli                       michel at ziobudda.net
Consulenza sistemistica in ambito OpenSource.
Sviluppo applicazioni web dinamiche (LAMP+Ajax)
Telefono: 0200619074
Telefono Cell: +39-3939890025 --  Fax: +39-0291390660

http://www.ziobudda.net                         ICQ: 58351764  
http://www.ziobuddalabs.it                      Skype: zio_budda
http://www.ajaxblog.it        			MSN: michel at ziobuddalabs.it                   
						JABBER: michel at gmail.com



More information about the support mailing list