点击不同的按钮,显示不同的输入文本框程序如何编写??
我想编写一个客户端动态程序代码,有A,B两个单选按钮,一个文本框和一个文件域,作用是选择A单选按钮,会显示输入文件域,个文件域灰度显示,选择B单选按钮时,显示文件域,文件域灰度显示,请问怎么编写,用什么语言能实现,JavaScript能实现吗??
------解决方案-------------------- <html xmlns= "http://www.w3.org/1999/xhtml ">
<head>
<title> Title </title>
<meta http-equiv= "Content-Type " content= "text/html; charset=gb2312 "/>
<meta name= "keyWords " content= "jymass.com,jymass "/>
<meta name= "description " content= "jymass.com,jymass "/>
<meta name= "author " content= "gradesystem@163.com "/>
<meta name= "robots " content= "index,follow "/>
<meta name= "copyright " content= "Copyright 2002-2006. www.jymass.com . All Rights Reserved. "/>
<link rel= "stylesheet " type= "text/css " href= " ">
<script language= "JavaScript " type= "text/javascript ">
<!--
function showForm() {
var sValue;
var arr = document.all( "isOK ");
if (arr.length){
for(var i=0;i <arr.length;++i){
if(arr[i].checked){
sValue = arr[i].value;
break;
}
}
}
if(sValue==0)
{
document.all( "txt ").disabled=false;
document.all( "txt ").focus();
document.all( "txtar ").disabled=true;
}
else if(sValue==1)
{
document.all( "txtar ").disabled=false;
document.all( "txtar ").focus();
document.all( "txt ").disabled=true;
}
else
{
document.all( "txt ").disabled=true;
document.all( "txtar ").disabled=true;
}
}
//-->
</script>
</head>
<body>
<input type= "radio " value= "0 " name= "isOK " onclick= "showForm() "> 文本框 <input type= "radio " value= "1 " name= "isOK " onclick= "showForm() " checked> 文本域
<p>
<input type= "text " name= "txt ">
<textarea name= "txtar " rows= "5 " cols= "40 "> </textarea>
</body>
</html>