我無法獲得表單將變量發佈到使用動態字段的另一個腳本?帖子表格不能與jQuery字段一起使用
編輯:腳本創建一個新的輸入字段行,但他們都沒有管理變量發佈到PHP腳本。
的jQuery:
<script type="text/javascript">
$(function(){
var newRowNum = 2;
$('#addnew').click(function(){
// increment the counter
newRowNum += 1;
var addRow = $(this).parent().parent();
var newRow = addRow.clone();
$('input', addRow).val($(this).val());
$('name', addRow).val('os' + newRowNum);
$('td:last-child', newRow).html('<a href="" class="remove">Remove<\/a>');
$('input', newRow).each(function(i){
var newID = 'os' + newRowNum + i;
$(this).attr('id',newID).attr('name',newID);
});
addRow.before(newRow);
$('a.remove', newRow).click(function(){
$(this).parent().parent().remove();
return false;
});
return false;
});
});
HTML:
<tr>
<td>
<input name="os21" type="text" id="os21" value="" size="24" maxlength="60" /></td>
<td>
<input name="os22" type="text" id="os22" value="" size="24" maxlength="60" /></td>
<td>
<input name="os23" type="text" id="os23" value="" size="10" maxlength="60" /></td>
<td><a id="addnew" href="">Add +</a></td>
</tr>
<tr><td colspan="3" align="left" style="text-align: right; padding-top: 10px;">
<input type="submit" value="Update">
</td></tr>
只有最初創建的字段(os21,os22和os23)到達服務器或根本沒有? – polarblau 2011-01-10 14:07:53
我沒有得到它,你想要exacly ..你想通過ajax或??????發佈到php腳本 – 2011-01-10 14:12:34