同一个jsp文件里代码如下
<select name="score" style="width:50px;" > <option>30 </option>  ----html
<option>20 </option>
<option>30 </option>
<option>40 </option>
------直到100 <input  type="hidden"  name="hiditem"  value="a.jsp?a=1&b=2&score=">
现在我将用 select的onclick事件把select的那个score的值加到hidden的value对应的url的最后 
这段代码(直接在上面的代码实现)的 onclick 函数该如何实现??

解决方案 »

  1.   

    select 实现onchange比较好点。加上事件响应。然后写javaScript实现。我是看见了懂,自己写有点生疏。等高人。
    Java&Oracle学习交流群,知无不言,言无不尽。欢迎大家交流分享学习工作心得。QQ群:20378027。另寻常在线,爱帮助人的群主俩名。
      

  2.   

    <select name=sel onchange="bao(this.options[this.options.selectedIndex].value)">
    <option value="">请选择
    <option value="1">Item 1
    <option value="2">Item 2
    <option value="3">Item 3
    </select>
    <script>
    function bao(s)
    {
        txt.value+=s;
        //选择后,让第一项被选中,这样,就有Change啦.
        document.all.sel.options[0].selected=true;
    }
    </script>
    <textarea id=txt></textarea>这个找到了  清问onclick的?
      

  3.   


    <script language="javaScript">
    function selscore(curpage)
    {
    document.sel.hiditem.value = "a.jsp?a=1&b=2&score="+document.sel.score.value;
    }
    </script>
    <form name="sel">
    <select name="score" style="width:50px;" onchange="selscore()">
    <option>30 </option>  ----html 
    <option>20 </option> 
    <option>30 </option> 
    <option>40 </option> 
    ------直到100 <input  type="hidden"  name="hiditem"  value="a.jsp?a=1&b=2&score="> 
    </form>
      

  4.   

    select 实现onchange比较好点
      

  5.   

    没click事件就三个 onblur="" onfocus="" onchange=""
      

  6.   

    如何把  txt的值给下面的  <a href>
    <a  href="#" onclick="document.location=hidden的那个value" 
    具体需要完善这段代码
      

  7.   

    我的最全面
       function bao(s) 

        txt.value+=s; 
        hiditem.value+=s;
        document.all.sel.options[0].selected=true; 
        
    } function   check(){   
      var   date1=hiditem.value;  
      
      alert(date1);   
      return true;
      
    }   
    </script> <BODY>
     
     <select name=sel onchange="bao(this.options[this.options.selectedIndex].value)"> 
    <option value="">choose
    <option value="1">Item 1 
    <option value="2">Item 2 
    <option value="3">Item 3 
    </select> <textarea id=txt>first </textarea> 
     <input id=hiditem type="hidden"  name="hiditem"  value="a.jsp?a=1&b=2&score="> 
     
     
      <input name="submit" type=submit value="Submit" onclick="return check();"/>
     现在在想办法把 如何把  txt的值给下面的  <a href> 
    <a  href="#" onclick="document.location=hidden的那个value" 
      

  8.   


    <script language="javascript">
    function ff(x){
    var a = document.getElementsByName("hiditem").value;
    a=a+x.value;
                                    document.getElementsByName("hiditem").value =a;
    }
    </script>
    <select name="score" style="width:50px;" onchange="ff(this)"> 给hiditem取个id = "hiditem"
      

  9.   

    <a     href= "# "   onclick= "document.location=hidden的那个value "
    这个问题已经解决如下 
      <a href= "#" onclick="document.location=hiditem.value">a</a>现在新问题是如下 
    多次点击的链接产生如下
    仅仅第1次是ok的  问这个问题如何解决
    第1次
    http://localhost:8080/addressbook/a.jsp?a=1&b=2&score=2
    第2次
    http://localhost:8080/addressbook/a.jsp?a=1&b=2&score=23
    第3次
    http://localhost:8080/addressbook/a.jsp?a=1&b=2&score=231我的任务要求的是 每次选择后清空的。 不能有值的
      

  10.   

    问题解决如下   function bao(s) 

        var link="a.jsp?a=1&b=2&score=";
        txt.value=link+s; 
        hiditem.value=link+s;
        document.all.sel.options[0].selected=true; 
        
    } 需要细心  这个问题基本完成
      

  11.   

    var a = document.getElementsByName("hiditem").value;
    一般不建议这样用 的     我记得上次这样用被cut掉
    一般都是用getElementsById
      

  12.   

    有没有什么工具可以看
    一个select或者像input
    有社么事件     以前一直在用  但没有统计思考这样的问题?
      

  13.   


    下面这个链接没有按控件分类的,说的比较笼统如果是struts,你可以看dtd文件对应标签,里面有事件名。
    http://lib.360doc.com/07/0727/11/18042_636034.shtml