Php 将表单发布到Color Box iframe,并在iframe中打开结果
我有一张表格Php 将表单发布到Color Box iframe,并在iframe中打开结果,php,jquery,html,ajax,colorbox,Php,Jquery,Html,Ajax,Colorbox,我有一张表格 <form method="POST" action="qwerty.php" /> <input type="text" name="merchant" /> <input type="text" name="password" /> <input type="submit" value="go" /> </form> 我想做的是将这些值发布到这个php中,并在模式窗口中自己打开结果或响应。这可能吗?有什么帮
<form method="POST" action="qwerty.php" />
<input type="text" name="merchant" />
<input type="text" name="password" />
<input type="submit" value="go" />
</form>
我想做的是将这些值发布到这个php中,并在模式窗口中自己打开结果或响应。这可能吗?有什么帮助吗?编辑: 通过使用Ajax和jquery,可以实现如下目的:
var merchant = $('form input:nth-child(1)').val();
var password= $('form input:nth-child(2)').val();
$('form input[type="submit"]').click(function() {
$.post( "qwerty.php", { merchant: merchant, password: password }, function(data) {
// #extraDiv is a div with display:none that will serve as a wrapper for the data
$('#extraDiv').html(data).colorbox();
});
});
然后在qwerty.php中提取您发送的值:
$merchant = $_POST['merchant'];
$password= $_POST['password'];
我对colorbox不太熟悉,但上面的方法可能有用。我不想弹出警报!我想使用ajax在颜色框iframe中打开响应