【发布时间】:2013-07-29 05:57:20
【问题描述】:
我有一个从 php 文件创建的表单和一个具有只读属性的文本字段,在单击编辑按钮时(在创建输入字段期间也会创建编辑按钮),我希望所述字段是可编辑,我该怎么做?
<td text align="center">
<input type="text" id=SOME_AMOUNT<?= $j; ?> value=<?=" " .$arr[$j]['BILL_AMOUNT'] . " "; ?> readOnly>
<button type="button" id=EDIT_AMOUNT<?php echo "$j"; ?> class="EDIT_AMOUNT btn btn-mini btn-primary"> Edit Bill</button>
$(document).ready(funcion(){
$(".EDIT_AMOUNT").click(function(){
var id=$(this).attr('id');
var index=id.match(/\d+$/)[0]; // to get the id numerals from the id string
$("#SOME_AMOUNT"+index).attr("readOnly", false);
});
});
编辑:问题似乎在于 php 文件中包含的用于表格对齐的 javascript。这怎么可能?
【问题讨论】:
标签: php javascript ajax arrays