[英]edit a textarea in jquery popup box
I have a div in which contents are displayed in ordered list with a checkbox for each. 我有一个div,其中内容显示在有序列表中,每个都有一个复选框。 these are displayed by fetching from the database. 这些是通过从数据库中获取来显示的。 now i need to display the content near to the selected check box. 现在,我需要在所选复选框附近显示内容。 what i did so far is 我到目前为止所做的是
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
The code is: 代码是:
$(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');
}
}
So far this is working perfectly. 到目前为止,它运行良好。 but now i need to display the content of the <p>
tag with id p_id
in a text area inside a popup window. 但是现在我需要在弹出窗口内的文本区域中显示ID为p_id
的<p>
标记的内容。 and then edit the text and by clicking the update button of popup box that content must be updated in db. 然后编辑文本,然后单击弹出框的“更新”按钮,必须在db中更新内容。
can anyone help me to find a solution for this. 谁能帮助我找到解决方案。
You need to create a php file that will receive the row id from database and prints it to textarea in a form. 您需要创建一个php文件,该文件将从数据库接收行ID,并将其以表格形式打印到textarea。 and when user clicks submit the form action will update the db. 当用户单击“提交”时,表单操作将更新数据库。 Here are the step by step guide what you need to do: 以下是逐步指南,您需要做什么:
Hope this will help you to finish. 希望这会帮助您完成。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.