一个textarea我在其中的内容将与每次复选框显示在排序列表一个div。这些通过从数据库中提取来显示。现在我需要显示选定复选框附近的内容。我做了什么至今编辑jquery的弹出框
1) only one check box can be selected at a time
2) get the id of the check box which is selected stored to variable ids
3) then paragraph content id = "p"+checkbox id
的代码是:
$(document).ready(function(){
$(':checkbox').bind('change', function() {
var thisClass = $(this).attr('class');
if ($(this).attr('checked')) {
$(':checkbox.' + thisClass + ":not(#" + this.id + ")").removeAttr('checked');
}
});
});
function edit_temp(prt){
var checkedAtLeastOne = false;
$('input[name="check_clinic"]').each(function() {
if ($(this).is(":checked")) {
checkedAtLeastOne = true;
ids = $(this).attr('id');
}
});
if(checkedAtLeastOne){
p_id ="p"+ids;
alert(p_id);
}
else{
alert('Please select any clinical Interpretation');
}
}
到目前为止,这是可以正常使用。但现在我需要在弹出窗口中的文本区域中显示<p>
标签的内容,其ID为p_id
。然后编辑文本,并通过单击弹出框的更新按钮,必须在db中更新内容。
谁能帮我找到了一个解决方案。
js请稍候。 – 2014-10-08 13:01:38