我想要达到这种效果
点击一下“参加活动”,在“参加活动的会员”下面显示自己的id和用户名

解决方案 »

  1.   

    显示一个列表,还是只显示一行div的信息。比如:<div>id: myId ;  用户名: json</div>描述的具体一点
      

  2.   

       <h4>参加活动的会员</h4>
             <div class="list4">
    <ul>
       <li>
        <p>显示会员id</p>
        <p>显示会员姓名</p>
       </li>
    </ul>
    <div class="clear"></div>
    </div>
            <div class="list5">
             <div id="top_btn">
                 <form method="post" action="$item[url]">
                        <span><input name="submit"  type="button" value="参加活动" onclick="return submit()" /></span>
                        <input type="hidden" id="uid" name="uid" value="$_SGLOBAL['supe_uid']" /> 
                        <input type="hidden" id="username" name="username" value="$_SGLOBAL['supe_uername']" />         
                     </form>
             </div>
    </div> 
      

  3.   


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Untitled Document</title>
    <script type="text/javascript">
    /**
     * @author: develop_design_level
     * @date: 2009-11-03
     * @param {Object} id
     */
    function $(id){
    if(document.getElementById){
    return document.getElementById(id);
    }else{
    return document.all.id;
    }
    }

    function fillDiv(){
    if ($('contentDivId').style.display == 'none') {
    $('contentDivId').style.display = '';
    $('contentDivId').innerHTML = '用户ID:hello_id;用户名称:hello';
    }else{
    $('contentDivId').style.display = 'none'
    }
    }

    window.onload = function(){
    $('btnId').onclick = fillDiv
    };
    </script>
    </head>
    <body>
    <input type="button" value="参加活动" id="btnId">
    <div>参加活动的会员</div>
    <div id="contentDivId" style="display:none;">&nbsp;</div>
    </body>
    </html>
    === 结贴,给分 ===
    得到满意的答案,立即结贴给分,是一种良好的习惯和美德
      

  4.   

    这个主要问题是value值里是个全局变量,还有在制定位置输出获取的值
      

  5.   


    哦。楼主,我看了你的这些代码,你把button标签放到了一个form表单里面。form表单会跳转离开这个当前页面的,就没法让上面的出现内容了。如果你要让上面的出现你要求的ID和用户名,你就用Ajax来实现吧,无刷新页面。这个你要是没有ajax基础,有点困难哦。
      

  6.   

    '用户ID:hello_id;用户名称:hello'
    这个可以用这个替换吗?
    <ul>
       <li>
        <p><a href="http://my.my57.com.cn/space.php?uid=$_SGLOBAL['supe_uid']"><img src="<!--{eval echo avatar($_SGLOBAL['supe_uid'], 'small');}-->" ></a></p>
        <p><a href="http://my.my57.com.cn/space.php?uid=$_SGLOBAL['supe_uid']">$_SGLOBAL['supe_username']</a></p>
       </li>
    </ul>
      

  7.   

    看你怎么对页面跳转了。如果你跳回当前页面,你这么做理论上是可以的。我是做J2EE的,对PHP不懂哦。呵呵 
      

  8.   

    能帮我整整吗?
    我有一点点基础xmlhttprequest
    可是我不会写
      

  9.   

    你去找一个jQuery的ajax调用例子,一看里面明白。google上面搜索一下 jQuery php。看看,应该就有你想要的东西。