sblatch
11-15-2012, 01:52 PM
I want to have a selection of form elements:
<form action="" method="post" enctype="multipart/form-data" name="mps_service" target="_top" dir="ltr" lang="en">
<select name="service" id="service">
<option value="buy">Buy a Home</option>
<option value="rent">Rent a Home</option>
<option value="sell">Sell a property</option>
</select>
</form>
Which then redirect to a relevant page once clicked. I do not want a submit button or to use a css menu as I want to be in the default form browser style to match other elements.
I have tried using the following in the <head>
<script type="text/javascript" language="javascript">
function redirectbuy()
{
document.location.href="http://www.buy-site.com"
}
function redirectrent()
{
document.location.href="http://www.rent-site.com"
}
function redirectsell()
{
document.location.href="http://www.sell-site.com"
}
</script>
and then changing the form code to:
<form action="" method="post" enctype="multipart/form-data" name="mps_service" target="_top" dir="ltr" lang="en">
<select name="service" id="service">
<option type onselect="redirectbuy()">Buy a Home</option>
<option type onselect="redirectrent()">Rent a Home</option>
<option type onselect="redirectsell()">Sell a property</option>
</select>
</form>
I am a total newbie and any guidance would really be appreciated.
<form action="" method="post" enctype="multipart/form-data" name="mps_service" target="_top" dir="ltr" lang="en">
<select name="service" id="service">
<option value="buy">Buy a Home</option>
<option value="rent">Rent a Home</option>
<option value="sell">Sell a property</option>
</select>
</form>
Which then redirect to a relevant page once clicked. I do not want a submit button or to use a css menu as I want to be in the default form browser style to match other elements.
I have tried using the following in the <head>
<script type="text/javascript" language="javascript">
function redirectbuy()
{
document.location.href="http://www.buy-site.com"
}
function redirectrent()
{
document.location.href="http://www.rent-site.com"
}
function redirectsell()
{
document.location.href="http://www.sell-site.com"
}
</script>
and then changing the form code to:
<form action="" method="post" enctype="multipart/form-data" name="mps_service" target="_top" dir="ltr" lang="en">
<select name="service" id="service">
<option type onselect="redirectbuy()">Buy a Home</option>
<option type onselect="redirectrent()">Rent a Home</option>
<option type onselect="redirectsell()">Sell a property</option>
</select>
</form>
I am a total newbie and any guidance would really be appreciated.