By nimzie on
I'm trying to make a custom search block, so I implemented the exact same code as I used in another search block (block-search.tpl.php).
<form action="<?php print base_path() ?>search/node/" accept-charset="UTF-8" method="post" id="search-block-form">
<input type="text" name="search_block_form_keys" id="searchfield" class="swap_value" value="enter search terms" />
<input type="button" name="op" id="searchgo" value="& go." />
<input type="hidden" name="edit[form_token]" id="edit-search-block-form-form-token" value="<?php print drupal_get_token('search_form'); ?>" />
<input type="hidden" name="form_id" id="edit-search-block-form" value="search_block_form" />
</form>
and I get the "Validation error, please try again. If this error persists, please contact the site administrator."
I've gone back to no custom file and I still get this validation error with a default search block.
I'm stumped and this is a showstopper on this project :(
Thanks for any help.
Cheers,
Adam
Comments
That validation error (which
That validation error (which I've come across myself) usually comes up when you have two different forms that are attempting to use the same form id.
HTH,
Dave
How do I work around this?
How do I work around this?
Or rather yet - what is the
Or rather yet - what is the base code for a generic search block?
I can start from there although I'm taking code from 2 other working implementations and they won't work in my block : same errors.
Thanks for any help.
Cheers,
Adam
In a site I admin, we need
In a site I admin, we need custom rendering of the default search form (the one in the top right), so we implemented theme_search_theme_form in our theme's template.php. However, this theming function doesn't exist beyond Drupal 5. I'm not sure what the Drupal 6 equivalent would be. Here's what ours looked like:
We included the login link inside the rendered form tag in order to make sure that the CSS would render things properly (we're building off legacy code :P)
HTH,
Dave
Odd - I don't know what I'm
Odd - I don't know what I'm missing to get these functions to hook. My theme is called brightwhite and I preface everything with brightwhite_ and rename the functions / calls to them. It doesn't seem to take @ all.
Any suggestions? I'm kind of lost on this one.
THing is, I've tried this on several different sites and it's worked... with the block-search.tpl.php file approach. Anyone should be able to drop that in their site folder and see if it works.??
I went with this approach.
I went with this approach. Now, I've got a little module and off we go. Drop me a line if you'd like it.
http://agaricdesign.com/note/validation-error-search-form-contact-site-a...
Cheers!
Run Cron
Yes, thats what I do whenever I come acroos thevalidation error. Simply run the cron job and you will see the error/ warning going away in fumes :-)
But it needs a more reliable reason as to wht it happens !
Imran Khan
Project Manager
New Earth Marketing