-1

I am calling the php file using jquery $.post method.At the time of the retriving the data I am getting an error.

I did search on google,found 4 to 5 solutions but those are not working.

Please help me.

this is my code,

Jquery

 $(document).ready(function(){

 $("[name='side_door_on_size']").click(function (){
        var side_door_on_size=$(this).val();
        $.post('<?php echo get_home_url(); ?>/wp-content/plugins/thermax/filter.php',
               {side_door_on_size:side_door_on_size}, 
               function(data){
                  alert(data);
              });
       })
  })

Html

<input type="radio" name="side_door_on_size" class="side_door_on_size" id="side_door_on_size" value="25m"/>25m
Naveen Kumar Alone
  • 7,536
  • 5
  • 36
  • 57
Manju
  • 747
  • 4
  • 10
  • 21

2 Answers2

0

Please add element name in jQuery selector $("input[name=side_door_on_size]"),

try this code

$(document).ready(function(){

 $("input[name=side_door_on_size]").click(function (){
        var side_door_on_size=$(this).val();
        $.post('<?php echo get_home_url(); ?>/wp-content/plugins/thermax/filter.php',
               {side_door_on_size:side_door_on_size}, 
               function(data){
                  alert(data);
              });
       })
  })
Girish
  • 11,907
  • 3
  • 34
  • 51
-2

please try with

<script>
    $(document).ready(function() {
        $("[name=side_door_on_size]").click(function() {
            var side_door_on_size = $(this).val();
            $.post('<?php echo get_home_url(); ?>/wp-content/plugins/thermax/filter.php', {side_door_on_size: side_door_on_size}, function(data) {
                alert(data);
            });
        });
    });
</script>
Laukik Patel
  • 733
  • 7
  • 18