Following is my code
$(."button").click(function(e){
// Declaring form and other stuff
$.ajax({
url:url,
method: "POST",
data:$form.serialize(),
success: function(responsehtml){
$form.replaceWith(responsehtml);
if(my condition){
$("#my_fieldset").prop("disabled",true);
}
}
});
The #my_fieldset belongs to the form that is being loaded into the responsehtml.
My form contains 3 different buttons which all can be clicked multiples times to get multiple items all in the same form.
On the click of the first item, my fieldset is being disabled( so my code is working fine until here)
On the click of the second item, the code is reaching until the prop disabled but it's not actually disabling the fieldset. Is it because the code is directing towards the first item itself. If that is the case, how can I disable the fieldsets belonging to other items as well.
Hope I made my question clear..