For maxdo not put quotation marks there:
var max = <%: Model.Project.RemainingBudgetHours %>;
To taskBudgetHoursuse the built-in JavaScript function parseInt:
var taskBudgetHours = parseInt($('#BudgetHours').val(), 10);
Note the use of the radix parameter for parseInt; this prevents, for example, "020"as being parsed as octal:
parseInt("020") === 16
source
share