1

jQuery(document).ready( function () { jQuery("#edit-suspension").change(function() { var basepath = Drupal.settings.basePath; var key = jQuery(this).val();

      //alert(key);
  jQuery.ajax({
           type:'POST',   
           url: basepath+ "custom_menu",
           data : {output:key},
            success:function(data)
            {
                     jQuery('#content').html(data);
              }  
        });
    });

how to get the output value in the menu function using $_POST method

  • Why you are writing javascript when you can use #ajax to your form element? – Sumit Madan Mar 29 '16 at 7:15
  • yeah but i am trying to do in JavaScript . And also i got output for this by using $_post; Answer is $_POST['output'] – logeshvaran Mar 30 '16 at 14:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.