I searched the forum and came across that thread but it didn't work for me. If there's something I missed please point me to it.
I have a dropdown in one of my websites and I'd like to deactivate the 'Submit' button when it shows the default selected value because people just click on 'Submit' and end up in 404 page.
I am a sucker for Javascript, so if someone could help would be really great.
Here's my HTML:
<div class="optin_box">
<h3 style="color:#fff !important;">Box Title</h3>
<p class="optin_text">Select your city:</p>
<form name="redirect">
<select name="selection">
<option>My city</option>
<optgroup label="Area 1">
<option value="http://domain.com">City 1</option>
<option value="http://domain2.com">City 2</option>
<option value="http://domain3.com">City 3</option>
</optgroup>
<optgroup label="Area 2">
<option value="domain4.com">City 4</option>
<option value="domain5.com">City 5</option>
</optgroup>
</select>
<br/>
<input class="button_link hover_fade red button_widget" style="font-size:14px;" type=button value="SUBMIT" onClick="WinOpen();">
</form>
</div>
And here's some javascript I have:
<script language="JavaScript">
function WinOpen() {
var url=document.redirect.selection.value
document.location.href=url
}
</script>
So what I am trying to achieve is that when someone sees 'My city' in the dropdown the 'SUBMIT' button should be deactivated.
Thanks in advance for any help. Kat