I want to create my own search form. How do I do this?

Problem:

I want to put a quick search form on my site as well as use my own search form on the advanced search page. How do I do this.



Solution:

First, this explanation will assume that you have a fair knowledge of creating forms in html and are familiar with the template structure of the software.

Second, to use your own search form on the advanced search page you must turn off the use of the dynamic search form. See admin > SITE SETUP > BROWSING SETTINGS for this switch. The MAINBODY tag will still need to be in the template used for this page as the MAINBODY tag will display the search results. Also, you will need a template created specifically for the advanced search page.

The software comes by default having the index.php file as the root file that all functions are initiated. If you have changed this then you will need to not use index.php as below but the file name that you have changed it to. For example purposes the below form is set using index.php.

Important notes:

1. ?a=19 is the link to the search function (see the form action below)
2. The name of the input must match the name of the field that is to be searched (see the names of each input)
3. The name of the select statement must equal c for using a dropdown category selection.
4. Within the select tag are option tags. These are the categories of the dropdown. The values of the option tags must match the category ids of your category structure. ( Look in the admin for these id numbers are simply hover your mouse over the category on the front page and the category id is the b value). Value = 0 is for an All Category search.
5. The hidden input tags tell what parts of the information of the ads to search.
6. To search a field by range that field must be set to number only. Meaning, when the user enters information into that field during ad/auction placement it will only allow numbers. You can set this in the admin.

**It can be helpful to view the source of the default search form to get an idea of the html needed to generate your search form.


Properties ID: 000060   Views: 4750   Updated: 3 years ago