By slayerment on
I am trying to submit a form with a text link (namely the search form) and it doesn't seem to be working. Everything with the form works fine, but if I change the submit button to something like:
$form['submit'] = array(
'#value' => '<a href="javascript:void(0);" onclick="document.getElementById(\'global-search-form\').submit();">Submit</a>',
);
it doesn't work. It submits the form fine and takes you to the search page, but the search is left blank.
If you would like you can test it on the site: http://www.gunslot.com. It is located in the top middle.
Thanks,
Quinton
Comments
Why not simply pass the
Why not simply pass the search query into the URL like; http://www.gunslot.com/search/node/testing
Pobster
--------------------------------------------
http://www.justgiving.com/paulmaddern
--------------------------------------------
I suppose that would work
I suppose that would work for this case, however, I also plan on doing this same type of thing for a number of other forms on my site such as the login which don't have parameters to be passed via the URI. I will go that route for now if there isn't a better way though :).
Thanks,
Quinton
*bump* Anymore ideas?
*bump*
Anymore ideas?
Did you ever get any where
Did you ever get any where with this ?
jQuery to the rescue
This is an old thread, but below is the way I worked it out in case it helps anyone.
a working example
This goal can be achieved with the javascript attached to the form. A working example here.