日期:2014-05-16  浏览次数:20323 次

让一个text从readonly状态恢复的问题,100分在线等
<%@   page   language= "java "   import= "java.util.* "   pageEncoding= "gb2312 "   %>
<html>
<head>
</head>
<script   language= "javascript ">
function   changetype()
{

if(document.forms[0].type[1].checked)
{
document.forms[0].belongto.enabled= "true ";
document.forms[0].projectname.readOnly= "true ";
}
if(document.forms[0].type[0].checked)
{
document.forms[0].belongto.disabled= "true ";
document.forms[0].projectname.readOnly= "false ";
}
}

function   init()
{
if(document.forms[0].type[1].checked)
{


document.forms[0].belongto.enabled= "true ";
document.forms[0].projectname.readOnly= "true ";
}
}
</script>
<body   bgcolor= "#66FF99 "   onload= "init() ">
<h1> 文件上传 </h1>
<form   name= "uploadform "   method= "POST "   action= "/SoftwareReuseLibrary/FileUpload "   ENCTYPE= "multipart/form-data ">
                <table   border= "1 "     cellpadding= "4 "   width= "800 "   cellspacing= "2 "   bordercolor= "#9BD7FF "   align= "center ">
<tr>
<td>
<input   type   = "radio "   name= "type "     value= "new "   onclick= "changetype() "> 新项目上传 </input>
<input   type   = "radio "   name= "type "     value= "update "   checked   onclick= "changetype() "> 更新已有项目 </input>
  </td>
</tr>
<tr>
<td> 新项目名称: <input   type= "text "   name= "projectname "/> </td>
</tr>
<tr>
<td>
请选择上传文件所属的项目:
<select   name= "belongto ">
<option   value= "null "   selected= "selected "> ---------- </option>
<option   value= "1 "> 111111 </option>
</select>
</td>
</tr>

                <tr> <td   colspan= "2 ">
                                              请选择你需要上传的文件: <input   name= "x "   size= "40 "   type= "file "/>
                </td>
</tr>

<tr>
<td>
文件功能描述: <br>
<textarea   name= "fd "   cols= "50 "   rows= "20 "> </textarea>
</td> </tr>

<tr> <td>
作者: <input   type= "text "   name= "author "/> </td> </tr>
                <tr> <td   align= "center "> <input   name= "upload "   type= "submit "   value= "开始上传