-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