当前位置: 代码迷 >> Java Web开发 >> 怎么读取文本框内容
  详细解决方案

怎么读取文本框内容

热度:87   发布时间:2016-04-17 13:46:49.0
如何读取文本框内容?
现有上下两个文本框,用户在第一个文本框内输入数据后,我想将其输入的内容保存到一个String类型的变量中,然后再将该变量内容显示到下一文本框内。

比如:1.文本框a   用户输入“001”
            2.取数据到String类型的变量str中
            3.然后在文本框b中显示001.  
前两步应该如何实现???

请教各位大侠!!!……

------解决方案--------------------
是在web里面还是在swing里面实现?
------解决方案--------------------
在 web 里

------解决方案--------------------
js实现?
------解决方案--------------------
〈input type= "text " name= "text1 " id= "text1 " onKeyUp= "chg() " >
〈input type= "text " name= "text1 " id= "text2 " >

function chg(){
var v=document.getElementById( "text1 ").value;
document.getElementById( "text2 ").value=v;
}
  相关解决方案