0
Hello I have a radio button q comes from ajax for calculation of front not it not worked to take the . attr({disabled: true}) from a button.
If I put it right on the page it works, but when it loads from an ajax request. No.
Inputs
<label class="radio">
<input type="radio" id="frete_radio" name="frete_radio" value="1">
<span>a</span>
</label>
<label class="radio">
<input type="radio" id="frete_radio" name="frete_radio" value="2">
<span>b</span>
</label>
If I load input:radio from ajax it does not make the code below work.
But if I put it right on the page it works.
Knob
<button type="submit" id="btn-finalizar" disabled="disabled">
Code:
<script type="text/javascript">
$(document).ready(function() {
$("input[type=radio]").bind("click", function(){
if($("input[type=radio]:checked").val() == "frete_radio") {
$("#btn-finalizar").attr({disabled: true});
} else {
$("#btn-finalizar").attr({disabled: false});
}
});
});
</script>