[英]How can I capture the data from an html form, process it with azure function and send a mail?
[英]How can i Send form data as mail and still submit
我的網站上有一個表格,訪問者將填寫並單擊提交,然后將其提交給我工作的公司。 我如何編寫一個代碼,如果單擊提交按鈕,將表單詳細信息發送到 php 文件並仍然執行原始操作(提交)。 我已經編寫了 php 代碼。
為此,您很可能需要了解一些前端知識。 我建議使用下面的直接JQuery
。 如果您有任何問題,請告訴我,很樂意為您提供幫助!
<form id="form">
<input type="submit" id="submit">
</form>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$('#form').on('submit', function (e) {
e.preventDefault();
$.post ("otherPage.php", $('#form').serialize()); //send data to php
$('#form').submit(); //submit original form
});
</script>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.