I have a working javascript version to disable/enable a from button but I can not get it working using jQuery.
My jsfiddle has both versions. The javascript version is commented out.
//NOT WORKING jQuery
function controls(id) {
if (id === "button_start") {
//$('button_start').prop('disabled','disabled');
// $('button_stop').removeProp('disabled','disabled');
// testing
$('#button_start').on('click',function() {
$(this).prop('disabled', 'disabled');
});
$('#button_stop').on('click', function(){
$(this).removeProp('disabled', 'disabled');
});
//console.log(id);
} else {
//$('button_stop').prop('disabled','disabled');
//$('button_start').removeProp('disabled','disabled');
// testing
$('#button_stop').click(function() {
$(this).prop('disabled', 'disabled');
});
$('#button_start').click(function(){
$(this).removeProp('disabled', 'disabled');
});
//console.log(id);
}
}
jsFiddle: https://jsfiddle.net/tommy6s/w2u8eskv/
Thank you for your help!