jquery enable select only if certain options are selected

i have this form that starts with 1 select DISABLED and 4 options i need a jquery that does this:

if OPTION #1 (on click) check if other options are selected and RESET (erase values and uncheck boxes)

if OPTION #2 (on click) ACTIVATE select menu and check if other options are selected and RESET (erase values and uncheck boxes)

if OPTION #3 (on click) check if other options are selected and RESET (erase values and uncheck boxes)

if OPTION #4 (on keyup) ACTIVATE select menu RESET and DISABLE other options

<!DOCTYPE html>
<html>
<script type="text/javascript">
    $(document).ready(function()
        {   

        }); 
</script>               
<body>
<select name="menus" id="menus" style="width:500px; height:200px" size="3"  disabled="disabled">
<option value="">Test#1</option>
<option value="">Test#2</option>
</select>
<div>
Option #1 <input name="op1" type="checkbox" value="">
</div>
<div>
Option #2 <input name="op2" type="checkbox" value="">
</div>
<div>
Option #3 <input name="op3" type="checkbox" value="">
</div>
<div>
Option #4 <input name="" type="text">
</div>
</body>
</html>

Answers


Updated fiddle: http://jsfiddle.net/zZSJb/3/


Something like this: http://jsfiddle.net/zZSJb/

$('#op1, #op3').click(function() {
    $('input[type="checkbox"]').removeAttr('checked');
    $(this).attr('checked', true);
});

$('#op2').click(function() {
    $('#menus').removeAttr('disabled');
    $('input[type="checkbox"]').removeAttr('checked');    
    $(this).attr('checked', true);
});

$('#txt').keyup(function() {
    $('#menus').removeAttr('disabled');
    $('input[type="checkbox"]').removeAttr('checked').attr('disabled', true);
});

You may need to fine tune it to your exact needs (which I couldn't completely figure out!).


Need Your Help

How to store name of file in folder to array in c ++?

c++ windows

I am new in c++ . And i want to write a function which takes names from folder.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.