Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
In UI:

1) I have to check the ComboBox
2) As HTTPGET, send the selected value of ComboBox
3) Then Uncheck the ComboBox, after execution of Controller Action Method.

Code:
JavaScript
$("#Search").click(function () {
        $(".selsts").attr('checked', false);
    });

This is my JQuery to uncheck the ComboBox On Button Click "Search".

Problem:

Before sending the Value to the controller Action, the checkbox get Unchecked and hence I am not receiving the CheckBox Value.

Any Suggessions/Help?
Posted
Comments
Brian A Stephens 25-Aug-14 13:32pm    
Could you post more code? Post the relevant HTML and HTTPGET request. Thanks.

1 solution

I'm guessing you are using jQuery AJAX, based on the jQuery tag on the question. In that case, you need to change your "checked" attribute in one of the callback functions to ensure that it fires after the AJAX is complete. You should use the success or complete callback function, depending on what you want.
JavaScript
$.ajax({
    url: whatever,
    data: { whatever: whatever },
    type: 'GET',
    success: function (data, status, jqXHR) {
        $(".selsts").attr('checked', false);
    }
});

The success callback function will fire only if there are no errors. The complete callback function will always fire, after the success callback, if there was one.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900