Gossamer Forum
Home : Products : DBMan : Customization :

Advance Search page in html.pl

Quote Reply
Advance Search page in html.pl
Hi..i would like to know if it is possible to do the following. There is a search page in html.pl called sub html_search_form that is for user to search. I would like to know if it is possible to add an advance search page that user can click on a link on sub html_search_form. Then user can go to the advance search page to do the other search. Also,i would like the advance search page made in html.pl.

could any one help me with it??

Thanks :)

Quote Reply
Re: Advance Search page in html.pl In reply to
Just to make things clear for anyone else reading this, there is not a subroutine called sub html_search_form in the DBMan files as the come in the distribution. This is a subroutine that you added.

Yes, you could make an advanced search form.

Create a new subroutine sub html_advanced_search_form. The best way to do this is the same way you created the other one -- copy sub html_record_form, paste it into your file, rename it and then make whatever changes you need to make. (It would be best to use sub html_record_form, because all of the fields should be in there already.)

Add a hidden field to the advance search form:


<input type="hidden" name="advanced" value="1">


In sub html_search_form, add a link

Code:

print qq|
<a href="$db_script_link_url&view_search=1&advanced=1">Advanced Search</a>
|;
In sub html_view_search, change


&html_search_form();


to

Code:

if ($in{'advanced'}) {
&html_advanced_search_form();
}
else {
&html_search_form();
}
In sub html_view_failure, change


&html_search_form(%in);


to

Code:

if ($in{'advanced'}) {
&html_advanced_search_form(%in);
}
else {
&html_search_form(%in);
}
JPD