-4
<div id="divForm" class="fancybox" style="display:none;">
<form id="frm_step1" action="download1.php" method="post">
<label>Enter Email</label>
<input type="email" name="email" id="email" value="" required />
<input type="button" name="submit" id="submit" value="Submit" class="form-submit" target-form="frm_step1" onclick="test();" />
</form>
</div>
function test() {
var email = $('#email').text();
alert(email);
$.ajax({
type: "POST",
dataType: "json",
url: 'download1.php?email' + email,
data: { 'email': email },
success: function(data) {
window.location.href = 'download.php#file';
},
error: function(e) {
alert('Error: ' + e);
}
});
}
我无法从这个获取电子邮件。当我提醒它时,它将返回空白。 我一直使用这样的jQuery/AJAX,但这次它不会提示邮件地址。无法获取电子邮件地址的onclick功能
我第一次使用VAL()而已,但仍然得到同样的错误。 – neha910
我没有收到任何错误,但我也没有收到电子邮件,只是返回空白。 – neha910
你做了什么,你运行相同的代码或你自己的代码。 – neha910