Forum for discussing general topics related to Couch.
3 posts Page 1 of 1
the normal search function:
Code: Select all
<cms:search_form msg="search a products..." processor="<cms:show k_site_link/>en/search.php" />

<cms:search keywords='man' masterpage='products.php'>
    <h3><a href="<cms:show k_page_link />"><cms:show k_search_title /></a></h3>
    <cms:show k_search_excerpt />
</cms:search>


How to add a validator on it? I want it to display something like "the code is too short" for the word length that less than 3.
I think using client-side validation (i.e. JS) would be quite appropriate for this.
As stated in the docs, we can hand-code the form instead of using <cms:search_form />
You can create and use your own form instead of using the one created by search_form tag. Just make sure that the textbox, within which the keywords will be inputted by the users, is named 's'.
@KK,

oh, I thought we can do something within no result:
<cms:no_results>
<h3>No pages found</h3>
</cms:no_results>

like text length < 3, it shows up "length too short" instead of "No pages found".
3 posts Page 1 of 1