這可能有點難以解釋,但我顯示的是2 x 2的網格。當您單擊單元格文本(比如0,1)時,它會帶來彈出一個框並將這些座標存儲爲隱藏值。那些隱藏的值將通過POST提交給表單。從表格中獲取數據HTML
這是我寫的,希望能夠澄清什麼,我試圖做一些示例代碼:https://jsfiddle.net/v08bzm9k/1/
<table border=1>
<tr>
<td class='grid-cells'><a href='#myPopup' data-rel='popup'>1</a></td>
<td class='grid-cells'><a href='#myPopup' data-rel='popup'>2</a></td>
</tr>
<tr>
<td class='grid-cells'><a href='#myPopup' data-rel='popup'>3</a></td>
<td class='grid-cells'><a href='#myPopup' data-rel='popup'>4</a></td>
</tr>
</table>
<div data-role="popup" id="myPopup" class="ui-content" style="min-width:250px;">
<form method="post" action="save-square.php">
<div>
<h3>Pick This Square:</h3>
<label for="name" class="ui-hidden-accessible">Name:</label>
<input type="text" name="name" id="name" placeholder="Name">
<label for="email" class="ui-hidden-accessible">Email:</label>
<input type="text" name="email" id="email" placeholder="Email">
<input type="submit" data-inline="true" value="Submit">
<div id='row'></div>
<div id='col'></div>
</div>
</form>
</div>
請問我存儲單元格的我點擊進入通過JavaScript的隱藏字段的值是多少?
聽起來很合理,如果這是你需要什麼在後端跟蹤 – charlietfl