点击不同的按钮,显示不同的输入文本框程序如何编写??
我想编写一个客户端动态程序代码,有A,B两个单选按钮,一个文本框和一个文件域,作用是选择A单选按钮,会显示输入文件域,个文件域灰度显示,选择B单选按钮时,显示文件域,文件域灰度显示,请问如何编写程序??
如下:
<input type= "radio " name= "radiobutton " value= "radiobutton "> A
<input type= "radio " name= "radiobutton " value= "radiobutton "> B
<form name= "form1 " enctype= "multipart/form-data " method= "post " action= " ">
<input type= "file " name= "file ">
</form>
<form name= "form2 " enctype= "multipart/form-data " method= "post " action= " ">
<input type= "file " name= "file ">
</form>
如何实现点击A时form1显示,form2灰度显示,点B击,form2显示form1灰度显示????
------解决方案-------------------- <TITLE> New Document </TITLE>
<META NAME= "Generator " CONTENT= "EditPlus ">
<META NAME= "Author " CONTENT= " ">
<META NAME= "Keywords " CONTENT= " ">
<META NAME= "Description " CONTENT= " ">
<SCRIPT LANGUAGE= "JavaScript ">
<!--
function controlForm(type){
if(type == 'A '){
form1.file.disabled = true;
form2.file.disabled = false;
}else if(type == 'B '){
form1.file.disabled = false;
form2.file.disabled = true;
}
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<input type= "radio " name= "radiobutton " value= "A " onclick= "controlForm( 'A ') "> A
<input type= "radio " name= "radiobutton " value= "B " onclick= "controlForm( 'B ') "> B
<form name= "form1 " enctype= "multipart/form-data " method= "post " action= " ">
<input type= "file " name= "file ">
</form>
<form name= "form2 " enctype= "multipart/form-data " method= "post " action= " ">
<input type= "file " name= "file ">
</form>
</BODY>
</HTML>