I have experimented with different methods to prevent the onClick event when selecting either placeholder, but I have not been successful. Here is my current code:
<div class="choosesign">
<div class="zodiacs">
<select id="zodiac-me" class="zodiac-me" name="zodiac1">
<option value="none"&>Your Sign</option>
<option value="1">Aries</option>
<option value="2">Aquarius</option>
<option value="3">Cancer</option>
<option value="4">Capricorn</option>
<option value="5">Gemini</option>
<option value="6">Leo</option>
<option value="7">Libra</option>
<option value="8">Pisces</option>
<option value="9">Sagittarius</option>
<option value="10">Scorpio</option>
<option value="11">Taurus</option>
<option value="12">Virgo</option>
</select>
</div>
<div class="zodiacs">
<select id="zodiac-them" class="zodiac-them" name="zodiac2">
<option value="none"&>Their Sign</option>
<option value="1"&>Aries</option>
<option value="2"&>Aquarius</option>
<option value="3"&>Cancer</option>
<option value="4"&>Capricorn</option>
<option value="5"&>Gemini</option>
<option value="6"&>Leo</option>
<option value="7"&>Libra</option>
<option value="8"&>Pisces</option>
<option value="9"&>Sagittarius</option>
<option value="10"&>Scorpio</option>
<option value="11"&>Taurus</option>
<option value="12"&>Virgo</option>
</select>
</div>
<div class="zodiacs" id="gobutton">
<a id="zodiacchoice" href="#" onclick='GotoLink()'> <h1>
GO</h1> </a>
</div>
</div>
<script>function GotoLink(){
var sel = $('.zodiac-me option:selected').text();
var sel2 = $('.zodiac-them option:selected').text();
if (sel=='Your Sign') {
document.getElementById("zodiacchoice").disabled = true;
} else {
document.getElementById("zodiacchoice").href = '/' + sel + '/' + sel + '-vs-' + sel2;
}
}</script>
I attempted to use an if statement to disable the onClick, but it did not work as intended. The link still functions correctly.