0
嗨,我想要做的更新功能,其中每個員工的平衡列在表中的一行。表單提交時,它只會提交特定的行。像這樣的東西。如何使用php和jquery獲取特定的行文本字段值?
我是新手到jQuery的,能有人給我一個方向?
<table id="rounded-corner">
<thead>
<tr>
<th scope="col" class="rounded-company">Name</th>
<th scope="col" class="rounded">Position</th>
<th scope="col" class="rounded">Annual Leave Balance</th>
<th scope="col" class="rounded">Sick Leave Balance</th>
<th scope="col" class="rounded">Action</th>
</tr>
</thead>
<tbody>
<?php foreach($list as $value) {?>
<tr id='<?php echo $value['IDSTAFFTABLE']; ?>'>
<td><?php echo $value['FIRSTNAME']; ?> <?php echo $value['LASTNAME']; ?></td>
<td><?php echo $value['POSITIONNAME']; ?></td>
<td><input type="text" name="annualleave" class="annualleave" value="<?php echo $value['ANNUALLEAVE']; ?>"/></td>
<td><input type="text" name="sickleave" class="sickleave" value="<?php echo $value['SICKLEAVE']; ?>"/></td>
<td><input type="submit" name="submit" class="submit" value="Submit" /></td>
</tr>
<?php } ?>
</tbody>