Skip to content

Instantly share code, notes, and snippets.

@NickDeckerDevs
Created August 10, 2018 20:01
Show Gist options
  • Select an option

  • Save NickDeckerDevs/fc8b933b594d6173b6969dd105d81b1e to your computer and use it in GitHub Desktop.

Select an option

Save NickDeckerDevs/fc8b933b594d6173b6969dd105d81b1e to your computer and use it in GitHub Desktop.
miller welidng form stuff
function count(answer) {
var count = 0;
$('#lro-quiz-1 input[type="radio"]').each(function() {
if ($(this).is(':checked') && $(this).val() == answer) {
count = count + 1;
}
});
return count;
}
$('.question input[type="radio"]').on('change', function() {
$('input.lro1_total_yes_answers').val(count('Yes'));
$('input.lro1_total_no_answers').val(count('No'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment