new to JavaScript seeking some help. I have a form with a select drop down with 5 options.
Option1
Option2
option3
Option4
Option5′
I need to have the form to redirect to another url if any of the options are selected apart from Option 1 which should be the default one on page load.
Thank you in advance
I only used the following
<form action="" id="main" name="main" method="get" onChange="top.location.href=this.options[this.selectedIndex].value;" value="GO">
<select id="Region" name="Region" tabindex="7">
<option value="/url">Option1</option>
<option value="/url">Option2</option>
<option value="/url">Option3</option>
<option value="/url>Option4</option>
<option value="" selected="selected">Option5</option>'
</select>
Just use a
onchnage Eventfor select box.And if selected option to be loaded at the page load then add some javascript code
for jQuery: Remove the onchange event from
<select>tag