当显示更改为阻止时,在html div中获取javascript变量

时间:2014-07-17 07:02:16

标签: javascript php html

我有一张表格,显示了用户的活动。在表中,用户名是一个超链接,显示该用户的详细信息为弹出窗口。在那个超链接中,在href中,我调用了一个javascript函数,它将弹出窗口的显示更改为阻止,我也将用户ID传递给该javascript函数。

我的任务是将用户id从函数获取到我显示为块的div,并在弹出窗口中显示该用户ID的用户详细信息。任何人都可以帮我从函数中获取div中的用户ID。

以下是代码:

html table

<table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered bootstrap-datatable" id="datatable">
<thead>
    <tr>
        <th>
            <input type="checkbox" id="selectall1" class="checkbox1" />
        </th>
        <th>Username</th>
        <th>User ID</th>
        <th>Status</th>
        <th>&nbsp;</th>
    </tr>
</thead>
<tbody>
    <?php $qry1="select * from tab_user_login where type='Advertiser' and (status='not approved' or status='verified')" ; $res1=mysql_query($qry1); while($row1=mysql_fetch_array($res1)) { $uid=$row1[1]; $status=$row1[6]; ?>
    <tr>
        <td>
            <input type="checkbox" class="checkbox1" name="chkbox[]" value="<?php echo $uid;?>" />
        </td>
        <td>
            <?php echo $row1[2];?>
        </td>
        <td>
            <?php echo $row1[1];?>
        </td>
        <?php switch($status) { case "approved": echo '<td><span class="label label-sm label-success">approved</span></td>'; break; case "not approved": echo '<td><span class="label label-sm label-warning">not approved</span></td>'; break; case "rejected": echo '<td><span class="label label-sm label-danger">rejected</span></td>'; break; case "suspended": echo '<td><span class="label label-sm label-danger">suspended</span></td>'; break; case "deleted": echo '<td><span class="label label-sm label-warning">deleted</span></td>'; break; case "stopped": echo '<td><span class="label label-sm label-danger">stopped</span></td>'; break; case "under review": echo '<td><span class="label label-sm label-warning">under review</span></td>'; break; case "verified": echo '<td><span class="label label-sm label-warning">verified</span></td>'; break; case "Approved": echo '<td><span class="label label-sm label-success">approved</span></td>'; break; case "Not Approved": echo '<td><span class="label label-sm label-warning">not approved</span></td>'; break; case "Rejected": echo '<td><span class="label label-sm label-danger">rejected</span></td>'; break; case "Suspended": echo '<td><span class="label label-sm label-danger">suspended</span></td>'; break; case "Deleted": echo '<td><span class="label label-sm label-warning">deleted</span></td>'; break; case "Stopped": echo '<td><span class="label label-sm label-danger">stopped</span></td>'; break; case "Under Review": echo '<td><span class="label label-sm label-warning">under review</span></td>'; break; case "Verified": echo '<td><span class="label label-sm label-warning">verified</span></td>'; break; } ?>
        <!--<td><span class="label label-sm label-warning"><?php //echo $row1[6];?></span></td>
                                    <td ><a href="" onClick="popupCenter('viewadv.php?advid=<?php echo $uid;?>')">View Details</a></td>-->
        <td><a href="" data-toggle="modal" onClick="showpopup('<?php echo $uid;?>')">View Details</a>
        </td>
    </tr>
    <?php } ?>
</tbody>

弹出

<div id="box-config-modal1" class="modal hide fade in" style="display: none;">
    <div class="modal-header">
        <button class="close" data-dismiss="modal">×</button>
         <h3>ADVERTISER DETAILS</h3>

    </div>
    <div class="modal-body">
        <p>Advertiser Details</p>
    </div>
    <div class="modal-footer"> <a href="#" class="btn btn-primary" data-dismiss="modal">Save Changes</a>
 <a href="#" class="btn" data-dismiss="modal">Cancel</a>

    </div>
</div>

的javascript

function showpopup(id)
{
document.getElementById('box-config-modal1').style.display='block';
}

0 个答案:

没有答案