I have this problem: I created feedback form (in form is question, then result(radio buttons from 1 to 5) and comment), this feedback has many question, which are loaded from database table questions. I want to dynamically set, that when user give result less than 3 on question comment on this question become the required. On other side, when user give result the better like mark 3 comment on this question is not required.
This is my feedback form:
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
@foreach (var item in Model)
{
<div class="form-group" style="text-align:center;">
<h2> @Html.Label(item.questions.question) </h2>
<div class="col-md-10">
<label class="radio-inline">@Html.RadioButton(item.question_id.ToString(), 1) 1 </label>
<label class="radio-inline">@Html.RadioButton(item.question_id.ToString(), 2) 2 </label>
<label class="radio-inline">@Html.RadioButton(item.question_id.ToString(), 3) 3 </label>
<label class="radio-inline">@Html.RadioButton(item.question_id.ToString(), 4) 4 </label>
<label class="radio-inline">@Html.RadioButton(item.question_id.ToString(), 5) 5 </label>
</div>
<div class="col col-md-10">
<label>comment: @Html.TextArea(item.question_id.ToString() + "_comment", new { @class = "form-control", @cols = 200, @rows=5 }) </label>
</div>
</div>
<hr>
}
<input type="hidden" name="feedback_id" value="@ViewBag.feedback_id">
<div class="form-group">
<div class="col-md-12" style="margin-left:330px;">
<input type="submit" value="Send" class="btn btn-primary btn-block" />
</div>
</div>
</div>
}