I use the following button.
<input type="button" id="attractionsSection" value="Warsztaty" onclick="location.href='@Url.Action("AddAttractions","ReservationDetails")'" disabled="disabled" />
In js script i check wheather some condition is true and then I set property disabled of button.
if(Model.stagesConfirmation[4]==true)
{
<script>
$(function () {
console.log('Test1');
document.getElementById('attractionsSection').disabled = 'true';
console.log(document.getElementById('attractionsSection'));
console.log('Test2');
});
</script>
}
I use console log to test wheather this condition is passed and that is OK. I set disabled and button still remains active. This console.log
console.log(document.getElementById('attractionsSection'));
shows me the following thing
<input type="button" id="attractionsSection" value="Warsztaty" onclick="location.href='@Url.Action("AddAttractions","ReservationDetails")'"/>
So it is not disabled. How to solve, what can be the problem?