阿贾克斯只返回第一个值

时间:2019-10-04 05:15:41

标签: ajax

//这是员工列表

         <div class="emp_list">
            <?php for ($i=0; $i <count($emp) ; $i++) { ?>
            <img style="width:30px;height:30px;float: left;border-radius: 50%;margin-top: 15px;" src="<?=base_url('uploads/')?><?=$emp[$i]->employee_image?>">
            <input  type="text" class="rid" name="rid" value="<?=$emp[$i]->employee_id?>">
            <br>
                <a href="#" id="one"  class="emp" style="margin-top: 10px;margin-left:10px;color: #000;"><?=$emp[$i]->employee_firstname?></a>



                <?php if($emp[$i]->employee_active=='active'){ ?>
                <span style="margin-left: 20px;">On</span>
            <?php }else{?>
                <span style="margin-left: 20px;">Off</span>

            <?php }?>
            <hr style="margin-top: 20px; margin-bottom: 20px;border: 0;border-top: 1px solid #000;">

    <?php }?> 

        </div> 

//这是ajax提交表单

                                                                                                                                                                                                                                    发送                                                                                                                  

//这是ajax代码 $(“。receiver_id”)。val($(“。rid”)。val()); this is always return first user id

0 个答案:

没有答案