*s

by KelseyW

HTML

<fieldset class="rating" id="ratingSystem">
  <input type="radio" id="star5" name="rating" value="5" autocomplete="off" />5*<label class="full" for="star5" title="Awesome - 5 stars"></label>
  <input type="radio" id="star4" name="rating" value="4" autocomplete="off" />4*<label class="full" for="star4" title="Pretty good - 4 stars"></label>
  <input type="radio" id="star3" name="rating" value="3" autocomplete="off" />3*<label class="full" for="star3" title="Meh - 3 stars"></label>
  <input type="radio" id="star2" name="rating" value="2" autocomplete="off" />2*<label class="full" for="star2" title="Kinda bad - 2 stars"></label>
  <input type="radio" id="star1" name="rating" value="1" autocomplete="off" />1*<label class="full" for="star1" title="Sucks big time - 1 star"></label>
</fieldset>

JavaScript

$(document).on("click", ".editAction", function (event) {

   $.post("/SearchCompetitor/GetCompetitor", { id: $(this).closest('tr').find('.idRow').attr('id') })
     .done(function (data) {
     $('#TextArea1').val(data.Comment);
     $("input[name='rating'][value='"+data.Rating + "']").attr('checked', 'checked');

     event.preventDefault();
     var l = document.getElementById('popap');
     l.click();
   });
});