我想從各種下拉框中完成的 HTML 表中獲取所有數(shù)據(jù)。我能夠成功通過電子郵件發(fā)送所有輸入字段,但無法弄清楚如何獲取 JSON 數(shù)據(jù)。我已將表數(shù)據(jù)轉(zhuǎn)換為 JSON,并且變量記錄正常。沒有后端數(shù)據(jù)庫,所有數(shù)據(jù)都是客戶端和靜態(tài) HTML。HTML<div class="row"><h4 class="info-text"> Tell us about yourself and the project you are working on.</h4><div class="col-sm-5 col-sm-offset-1"> <div class="form-group"> <label>Contact Name <small></small></label> <input name="name" type="text" class="form-control" placeholder="Contact Name..." id="name"> </div> <div class="form-group"> <label>Contact Number <small></small></label> <input name="phone" type="text" class="form-control" placeholder="Number..." id="number"> </div></div><div class="col-sm-5 "> <div class="form-group"> <label for="project">Please tell us a little about the project you are working on <small></small></label> <textarea class="form-control" name="project" rows="5" id="project"></textarea> </div></div><div class="col-sm-10 col-sm-offset-1"> <div class="form-group"> <label>Email <small></small></label> <input name="email" type="email" class="form-control" placeholder="email@email.com" id="email"> </div></div><div class="col-sm-10 col-sm-offset-1"> <div class="form-group"> <label>Upload a file should you wish to</label> <input name="file" type="file" class="btn btn-info" placeholder="email@email.com"> </div></div><table class="table"> <thead> <tr> <th scope="col">#</th> <th scope="col">Product</th> <th scope="col">Ancillary Quantity</th> <th scope="col">Fire Rating</th> <th scope="col">Void Gap (mm)</th> <th scope="col">Cut Type</th> <th scope="col">Quantity</th> <th scope="col">Bracket Finish</th> </tr> </thead> <tbody> <tr> </tr> </tbody></table>這是用于表格數(shù)據(jù)的 jQuery 循環(huán)$("#next").click(function () {var table = $("table tbody");table.find('tr').each(function (i) {});
1 回答
慕尼黑8549860
TA貢獻1818條經(jīng)驗 獲得超11個贊
在您的控制器上使用json_decode()
$tableData = json_decode($request->row, true); # true -- get as array
然后將 $tableData 傳遞給您的電子郵件刀片并打印。
https://www.php.net/manual/en/function.json-decode.php
- 1 回答
- 0 關(guān)注
- 157 瀏覽
添加回答
舉報
0/150
提交
取消
