dragon19720808 2011-09-20 20:07
浏览 28

基于动态输入的可排序列标题?

Firstly I'd like to apologize for the topic question... I simply couldn't think of a question. Mainly because I don't know what I am looking for. I just need a hint or a pointer to the general direction of how to solve my problem. I think this is where my inexperience with the web shows a little... Anyway!

So what I have right now is a drop down with users in it. Select the user, and info comes up in 4 columns. That info needs to be sortable from the column headers. I can do both things independently from each other (the selection and the sorting), but I think the post/submit of the dropdown happens before I can save the variables to be passed in the URL, so I can't get it to behave properly.

So here's the code:

<form action="" method="post">
<input type="hidden" name="user_id" value="<?php echo $user_id; ?>">
  User: <select name="user_id">
<?php foreach($users as $user): ?>
<option value="<?php echo $user['id']; ?>" <?php echo ($user_id == $user['id'] ? 'selected' : ''); ?>><?php echo $user['name']; ?></option>
<?php endforeach ?>
</select>
<input type="submit" name="submit" value="Select">
</form>

<table id="one-column-emphasis" summary="All Accounts">
<thead>
<tr>
<th style="width:20%"><a href="index.php?module=task_queue_list_per_user&action=view_list&sort=name">Name</a></th>
<th style="width:10%"><a href="index.php?module=task_queue_list_per_user&action=view_list&sort=priority">Priority</a></th>
<th style="width:10%"><a href="index.php?module=task_queue_list_per_user&action=view_list&sort=created_date">Date Created</a></th>
<th style="width:10%"><a href="index.php?module=task_queue_list_per_user&action=view_list&sort=created_date">Age</a></th>
</tr>
</thead>

What I think is happening is that the submit happens before the variables can be set to send to the database file. If I have a user selected and click on the column header to sort it, it takes me back to the default where there is no user selected.

Any ideas, tips or help? Thanks

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
    • ¥50 我撰写的python爬虫爬不了 要爬的网址有反爬机制
    • ¥15 Centos / PETSc / PETGEM
    • ¥15 centos7.9 IPv6端口telnet和端口监控问题
    • ¥120 计算机网络的新校区组网设计
    • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
    • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
    • ¥20 海浪数据 南海地区海况数据,波浪数据
    • ¥20 软件测试决策法疑问求解答
    • ¥15 win11 23H2删除推荐的项目,支持注册表等