views:

13

answers:

1

Hi,

I have a jump list that works fine. Basically the user selects an option from the drop down and the selection is posted to a search form.

Here is the code:

<form id="brandForm" name="brandForm" method="post"
action="http://www.domain.com/search.php"&gt;
<select name="stext" id="stext" 
onchange="document.brandForm.submit()">
    <option selected="selected">Select Products...&nbsp;&nbsp;</option>
    <option value="Option1">Option 1</option>
    <option value="Option2">Option 2</option>
</select>
<input name="posted" id="posted" value="1" type="hidden">
</form>

What I am now trying to do is have the list displayed as a list of links instead of a drop down rather like the 'related tags' you see on sites. Eg. on a page about footballs a list of words such as Football, Soccer World Cup, Sport, Stadium, Fan, Crowd, Cheering, Spectator will be displayed and when one is clicked it performs the same function as my jump list and posts the term to search.php.

I just cannot seem to get this working and I was hoping a fresh pair of eyes would have a solution.

Thanks

A: 

So you want plain old hyperlinks instead of the pick list?

It's still early, I haven't had coffee, so this probably doesn't exactly parse, but something like this maybe?

<input name="stext" id="stext" value="" type="hidden"/>

<a href="#" onclick="document.brandForm.stext='Option1' ; document.brandForm.submit()">Option1</a>

That is, clicking the link sets a hidden form field and then submits the form.

Rodney Gitzel
Hi Rodney,Thank you for your reply but unfortunately it doesn't post the selection to the search input.When a selection is made from the jump menu it posts the term to the search input on search.php and submits it so the results are shown automatically.This is what I would like to do but from a list.Are there any other solutions?Thanks
Quadrant1