-2

When I'm getting E-mail message I can not identify which checkbox is checked.

My JS code looks like this:

$(document).ready(function(){

$('#submit').click(function(){
    $.post("submit.php", 
        {service1: $('#service1').val(), 
         service2: $('#service2').val(), 

        function(data){
            $('#response').html(data);
        }
    );

});

What should I add to my code to identify which is checked? Thanks

3
  • What problem are you getting? What's your HTML markup? Commented Nov 14, 2016 at 16:02
  • $('#service2').is(':checked') will be true or false Commented Nov 14, 2016 at 16:03
  • I didn't see anything related to checkbox in your code.. Commented Nov 14, 2016 at 16:03

1 Answer 1

0

$('#services1').prop('checked') should do the trick.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.