我在我的網站上有一個表單。問題存儲在數據庫中,一些變量決定你看到的問題。因此,問題的數量是未知的。對於這些問題的代碼是這樣的:未知數量變量的AJAX帖子
HTML
<ol class="questions">
<?php
$number = 1;
while($row = mysql_fetch_assoc($result)) {
echo '<li>';
echo '<span><label for="q'.$number.'">'.$row['question'].'</label></span>';
echo '<input id="q'.$number.'" name="q'.$number.'" type="text" value="'.$row['description'].'" onclick="this.value="";this.onclick="test";this.style.color="#000000"; setAttribute("type", "text");" onfocus="if (this.value == "'.$row['description'].'") {this.value = ""; setAttribute("type", "text");}" onblur="if (this.value == "") {this.value = "'.$row['description'].'";setAttribute("type", "text");}"/>';
echo '</li>';
$number++;
};?>
</ol>
現在,在提交我要發佈這些問題的答案與AJAX的形式。我該如何處理未知數量的問題?
哪裏是ajax代碼? – Geo