@**@
@foreach (var item in Model)
{
@**@
}
@Html.DisplayNameFor(model => model.TestName)
| @Html.DisplayNameFor(model => model.QuestionName)
| @Html.DisplayNameFor(model => model.Skill)
| @Html.DisplayNameFor(model => model.Level)
| @Html.DisplayNameFor(model => model.Percentage)
|
---|
@Html.DisplayFor(modelItem => item.TestName)
| @Html.DisplayFor(modelItem => item.QuestionName)
| @Html.DisplayFor(modelItem => item.Skill)
| @Html.DisplayFor(modelItem => item.Level)
| @Html.DisplayFor(modelItem => item.Percentage)
|
}
<script type="text/javascript">
var current = 100;
function NotiFyUser() {
// current++;
var QnName = $('#QnName').val();
var NoOfqn = $('#NoOfqn').val();
var SkillId = $("#SkillId :selected").text();
var LevelId = $("#LevelId :selected").text();
var Percentage = $('#Percentage').val();
if (Percentage == 0) {
alert("Percentage can not be 0");
return false;
}
else if (Percentage <= current) {
$('#table tr:Last').after('
' + SkillId + ' | ' + LevelId + ' | ' + Percentage + ' |
');
$("#QnName").attr("disabled", "disabled");
$("#NoOfqn").attr("disabled", "disabled");
$('#TestName').val(QnName);
$('#Total').val(NoOfqn);
$('#TestName').attr("disabled", "disabled");
$('#Total').attr("disabled", "disabled");
} else {
alert("Sum exceeds 100 try to enter lower Percentage");
return false;
}
current = current - Percentage;
$('#Percentage').val(current);
console.log(Percentage);
console.log(current);
}
</script>