Get the radio button value through ajax to php file

前端 未结 5 945
失恋的感觉
失恋的感觉 2021-02-11 07:44

After clicking the radio button, the value from the radio button is not being passed when the onclick event is triggered. Here is my code:



        
5条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-11 08:08

       Mbyllur
    Hapur
    function MyAlert() { var radio1=$('input[type="radio"]:checked').val(); var pass_data = { 'radio1' : $('input[name=status]:checked').val(), }; alert(pass_data); $.ajax({ url : "", type : "POST", data : pass_data, success : function(data) { } }); return false; }

提交回复
热议问题