开发者

Privillage Module Search on Username (PHP,JQuery,Javascript)

I'm doing a module where a user suppose to assign i开发者_运维问答nto a specific group. With a bunch of list of users, I was thinking of if I'm doing checkboxes it might be crazy of scrolling. Unless I do a search sorting method. Somehow don't know which searching method is more reliable.

Any suggestions and ideas on it ? Much appreciate for the response.


Do the users potentially belong to more than one group?

If so, try a dynamic combo-box(<select multiple>), which is populated with the groups. Useful for setting groups for the users or getting a list of users from multiple groups.

If not, just use a regular old drop-down selection (<select>) populated with the groups for assigning them. Might still want a combobox for searching though, since you can select multiple groups at once.

Something like:

<?php
$groups = //array of group names pulled from somewhere, such as an array pulled from MySQL
echo '<select name="groups[]" multiple>';
foreach($groups as $group)
{
    echo '<option value="' . $group['id'] . '">' . $group['name'] . '</option>';
}
echo '</select>';
?>

Unless I'm not getting what you're asking.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜