I have a page with several links. I want to make that when a user clicks link #1 he will be redirected to a contact form and select item #1 in the dropdown menu. Same goes for #2 and item #2 in the dropdown menu. Is this possible ?
A:
You will have to pass a query string value through your links and use that value to pre-select an item from your selectbox, example:
<a href="mysite.com?var=test">Link One</a>
Now you can get the value of var=test
query string and make a condition if it is set, you pre-select an option from the select dropdown based on that variable.
Sarfraz
2010-07-22 07:49:43
A:
Yes, it is possible, but you will have to use Javascript for this:
<script type="text/javascript">
function SetItem(item)
{
document.myForm.myDropDown[item].selected = true;
}
</script>
<a href="#form_anchor" onclick="SetItem(0)">Select 1st item</a>
Edit:
After reading sAc's answer, I'm not sure if you need the functionality to be available on the same page (in which case you can use the solution I proposed) or in a different page (in which case you should follow sAc's solution).
Anax
2010-07-22 07:53:01