I want to hide a button based on a value in my model which I am passing to the page.
@model Indigo.Contracts.DataContracts.JobDetailDto
@{
Layout = "~/Views/Shared/_Layout.cshtml";
}
<script>
$(document).ready(function () {
if(@Model.StatusNameInternal === "Completed")
{
$('#cancelButton').prop("hidden", true);
}
});
</script>
<table>
<tr>
<td> </td>
<td><input type="submit" id="cancelButton" value="Cancel" /></td>
<td><input type="submit" id="restartButton" value="Restart" /></td>
<td><input type="submit" id="finalizeButton" value="Finalize" /></td>
</tr>
</table>
What I would like to do is, when my document is ready, check if the StatusNameInternal = "Completed", then hide the cancelButton.