I need a simple code to disable the button to send the form to the following conditions:
If the selected <input type="radio"> with ID "#radio_one" and then check only one <input type="text"> with ID "#text_one".
OR
If the selected <input type="radio"> with ID "# radio_two" and then check two <input type="text"> with ID "#text_one" and also with ID "#text_two".
And, if provided with one or two <input type="text"> will be empty, add for a button <input type="send"> attribute disabled="disabled" if, however, will once again fill this attribute is removed from the button.
Sorry for my English, I used Google Translator: (
I dont have another code, I hope you understand me, so I created some simple jQuery code which can then possibly edit.
Thanks
Edit: This does not work:
$("#send_button").attr("disabled", "disabled");
if ($('#absence_one').checked && $('#cal_from').val().length > 0) {
$("#send_button").removeAttr("disabled");
}
if ($('#absence_more').checked && $('#cal_to').val().length > 0) {
$("#send_button").removeAttr("disabled");
}