Here is my code:
<form name="f1" method="get">
<r><label for="wlk_logo_align">Logo Alignment</label><br/>
<div class="leftdropdown leftdropdown-dark">
<select id="select1" name="s1" class="leftdropdown-select" >
<option value="default" selected="selected">Default
<option value="http://www.java2s.com">Java2s.com
<option value="http://www.google.com">Google
<option value="http://www.msn.com">msn
<option value="http://www.perl.com">Perl.com
<option value="http://www.php.net">Php.net
</select>
</div>
</r>
<r><label for="wlk_logo_align">Color Scheme</label><br/>
<div class="leftdropdown leftdropdown-dark">
<select id="select2" name="s2" class="leftdropdown-select">
<option value="default" selected="selected">Default
<option value="http://www.1.com">1
<option value="http://www.2.com">2
<option value="http://www.3.com">3
<option value="http://www.4.com">4
<option value="http://www.5.net">5
</select>
</div>
<INPUT type="button" name="go" value="s1 button" onClick="window.location=document.f1.s1.options[document.f1.s1.selectedIndex].value">
<INPUT type="button" name="go" value="s2 button" onClick="window.location=document.f1.s2.options[document.f1.s2.selectedIndex].value">
<button type="reset" class="right" onclick="document.forms['f1'].reset();">Reset</button>
As you can see, I had to use two buttons and one reset button.
I need a correct code that I just use one button that it will work for both and reset button will clear both of them.
Here is jquery code:
$('#select1').on('change', function(){
if($(this).val() != 'default'){
$('#select2').prop('disabled', true);
}
else{
$('#select2').prop('disabled', false);
}
});
$('#select2').on('change', function(){
if($(this).val() != 'default'){
$('#select1').prop('disabled', true);
}
else{
$('#select1').prop('disabled', false);
}
});
For more information, if you select Google item from first list, then try to use reset button, however both of drop downs menus will set to default, but still one of them is disabled.
I need a code to reset both of items perfectly, and one button that it will work for both of them cause I had to use two buttons for both of items.
I really appropriate for your help on this issue.
Regards