我有一個帶有“i”標簽和“input”標簽的表單。
該表單從用戶那里獲取資訊并通過 PHP 將其發送到我的電子郵件。
我能夠收到電子郵件,但缺少“i”標簽中的資訊。我只在我的電子郵件中收到“輸入”標簽。這是我的代碼。
typeQue = $("select#need-type").children("option:selected").val();
if (typeQue === "type-ch" ) {
var typeFee = 0;
typeCharges = typeFee;
}else if (typeQue === "type-1" ) {
var typeFee = 10;
typeCharges = typeFee;
}else if (typeQue === "type-2" ) {
var typeFee = 20;
typeCharges = typeFee;
}
$("#type-result").html('RM' typeCharges);
<form action="forms/custom-quote.php" method="POST" class="needs-validation row" novalidate>
<select name="need-type" type="text" id="need-type">
<option value="type-ch">- Choose type -</option>
<option value="type-1">Coffee</option>
<option value="type-2">Donut</option>
</select>
<input type="text" placeholder="Alif Ibrahim" id="fname" name="custom-name" required>
<label for="fname">Your Name<span style="color:rgb(255, 0, 0)"> *</span></label>
// Here show result from type
<i id = "type-result" type ="text" name = "typeAnswer"></i>
<button class="btn btn-primary w-100" type="submit">Submit Price</button>
</form>
我以影像格式包含我的 php 代碼,因為當我嘗試在此處插入它時,它顯示我的帖子不會被發布。

uj5u.com熱心網友回復:
標簽不是表單資料
創建一個隱藏輸入并將其設定為相同的值,您將收到它
<i id="type-result"></i>
<input id="type-result-hidden" type="hidden" name="typeAnswer">
然后在代碼中
$("#type-result").html('RM' typeCharges);
$("#type-result-hidden").val('RM' typeCharges);
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/438223.html
上一篇:css依次排列兩個元素
下一篇:單擊不同的鏈接時更新打開的選項卡
