Support

Account

Home Forums General Issues Ajax error: Class acf_field not found. Reply To: Ajax error: Class acf_field not found.

  • Thanks for your response, actually this does not solve the issue. Let me explain better.

    This is a part of my php file for the field:

    <?php
    
    class acf_field_number_range extends acf_field
    {
    
    (..)
    
    <script type="text/javascript">
    
    $("#slider").bind("valuesChanged", function (e, data) {
       $.ajax({
       type: "POST",
       dataType: "text",
       url: "../wp-content/themes/twentytwelve/fields/test.php",
       data: { minValue: data.values.min, maxValue: data.values.max },
       async: false,
       success: function(data){
          alert(data);
          
        },
         error: function(xhr) {
                 alert('fail')
                }
     });
    });
    
    </script>

    But the alert popup gives this error:

    Fatal error: Class ‘acf_field’ not found in /home/…/…etc/../..etc/ test.php</b> on line 3

    How can I get these values of the range slider? Thanks