如何获取特定动态创建的文本框的标签值

时间:2018-03-03 12:33:00

标签: php jquery

我有一个表,其中一个元素是我的id而另一个是标记,通过从数据库中获取数据,表中有许多行,其中包含许多id和textbox。如果我尝试将值输入到文本框并插入到表中,则标记的值始终为最后一个id。有没有办法链接他们?

<table class="table table-bordered table-hover">
<thead>
  <th>id</th>
    <th>marks</th>
    </thead>
  <tbody>
echo"<script>   var stu_id={$stu_id};        var sub_id={$sub_id};</script>";
$statusquery="SELECT * from module WHERE module_stu_id={$stu_id} and module_sub_id={$sub_id}";

        $statusofmodule=mysqli_query($connection,$statusquery);
        if(mysqli_num_rows($statusofmodule)>0)
        {
        $row=mysqli_fetch_assoc($statusofmodule);

          $status=$row['status_detail'];
          $remainq=$row['remainq'];
          $attempts=$row['attempts'];

      }
<?php
  echo"<td width=auto ><input type='number' id='rq'  name='remainqq' onchange=\"getremainq(this.value,i,sub_id,module_no)\" style=' width: 30px'  ></td>";
  ?>
the stu_id and sub_id i got from tables that code not mentioned here

0 个答案:

没有答案
相关问题