Answer the question
In order to leave comments, you need to log in
How to control the checkbox when value is set?
$(".update").click(function() {
if ($("#top").val('notop')) {
$('input[name="top"]').attr('checked', false);
} else {
$('input[name="top"]').attr('checked', true);
}
});
Answer the question
In order to leave comments, you need to log in
just pull data from your system in the appropriate view in any convenient (whatever) way.
$('.update').click(function() {
$('input[name="top"]').prop('checked', $('#top').val() !== 'notop');
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question