Gossamer Forum
Home : Products : DBMan : Customization :

Using radio button to return search results

Quote Reply
Using radio button to return search results
Hi,
Here's what I would like to do. In my dbman boat classifieds I use radio buttons for visitors to specify a category under which they would like to add a record ie. "motor boats", "Sailing yachts", etc.

My permissions are set so that anyone can view the ads without logging in and only those with accounts can add, delete, modify.

I am using JPD's short/long html.pl
So in the sub_html_home where all visitors start I would like to place the radio buttons mentioned above displaying the different boat categorys. Then I imagine a submit button so that all records in that category are shown.

This is already possible when visitors perform a search but they have to go there first and I would like this possibility to be available on the first page (sub_html_home)


------------------
Henk Jan Buchel
Classic Boatworld
http://classicboatworld.net
Quote Reply
Re: Using radio button to return search results In reply to
Do you just want to put a short search form in sub html_home?


------------------
JPD





Quote Reply
Re: Using radio button to return search results In reply to
I would like to keep the navigation for "view,search,list all,log off" in the footer at the bottom of the page.

Then in the middle of the page I would like to see the 5 categories (radio button values)so a visitor could just click on "sailing yachts" for instance and receive all those listings.

This way those interested in viewing a specific category wont have to go to the search form first.

I guess I'm trying to set up a hyperlink that tells the sub_html_view_succes which records to show.



------------------
Henk Jan Buchel
Classic Boatworld
http://classicboatworld.net
Quote Reply
Re: Using radio button to return search results In reply to
Okay. You'll set up a short search form in sub html_home.

Use the following:

Code:
print qq|
<form action="$db_script_url" method="GET">
<input type=hidden name="db" value="$db_setup">
<input type=hidden name="uid" value="$db_uid">

At this point, you'll need to define your radio buttons. Use

Code:
<input type="radio" name="name of the field you want to search on" value="sailing yachts">Sailing yachts<BR>
<input type="radio" name="name of the field you want to search on" value="rowboats">Rowboats<BR>
<input type="radio" name="name of the field you want to search on" value="ocean liners">Ocean liners<BR>

Just make sure that the name= is the name of the field you want to search on and the value= matches the entries in that field.

End the form by using

Code:
<INPUT TYPE="SUBMIT" NAME="view_records" VALUE="Search">
<INPUT TYPE="RESET" VALUE="Reset">
</form>|;


------------------
JPD





Quote Reply
Re: Using radio button to return search results In reply to
Yahoo! Thats great thanks a lot!

Had'nt thought about ocean liners yet so thanks for the tip.

What would be the value to "list all" as I would like to have that in there with the other options. I suppose I could add a radio button in the html that passes that value to the view_search.

Visitors could always scroll down to the nav bar in the footer, but I would like to include the "List All" with the other radio options.

Regards,

------------------
Henk Jan Buchel
Classic Boatworld
http://classicboatworld.net
Quote Reply
Re: Using radio button to return search results In reply to
"List all" would be

Code:
<input type="radio" name="name of the field you want to search on" value="*">List All<BR>

You're welcome. Smile

------------------
JPD