validation on back end as well as on front end in ASP.NET MVC
for the feedback rating system as shown in the picture for 2 cases
1 By default one star i seelcted
2 The selection/filling of the star is mandatory
the html code
<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl>" %>
| <%=i %>. | <%=item.QuestionText %><%} %> <% if (item.FbQTypeId != 1) {%> <%} %> <% else { %> |
// var rateval;
//function getRating(val) {
// rateval = val;
//};
//$(function () {
// debugger;
// var $radios = $('input:radio[value=1]');
// if ($radios.is(':checked') === false) {
// alert('Checking the star is mandatory');
// $radios.filter('[value=1]').prop('checked', true);
// }
//});
//$(function () {
// debugger;
// alert('Checking the star is mandatory');
//});
1 Reply
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Puneet KankarPosted Jul 24, 2017, 7:12 AM