提交在弹出窗口中创建的表单

提交在弹出窗口中创建的表单

问题描述:

I have a page where I create a popup. On the popup created, I click on a radio button created on the popup and on click of a button I need to submit the form and pass the radio button value using post method to a new page. How can I achieve this using jquery or javascript?

我有一个页面,我在其中创建一个弹出窗口。 在创建的弹出窗口中,我单击弹出窗口上创建的单选按钮,然后单击我需要提交表单的按钮,并使用post方法将单选按钮值传递到新页面。 如何使用jquery或javascript实现此目的? p> div>

Try using AJAX:

Reference: http://api.jquery.com/jQuery.ajax/

$.ajax({
  type: "POST",
  url: "post_page.php",
  data: { radio: $("radio_btn").val() }
}).done(function( msg ) {
  alert("Done!");
});