如何清空Form内输入框、下拉框的内容或还原为默认值?
我写了一下代码,可是说脚本错误,好像没有什么错误啊?
<script language="javascript">
function resetvalue()
{
if (document.all("Keywords") != null) document.all("Keywords").value="";
if (document.all("FromDate") != null) document.all("FromData").value="";
if (document.all("EndDate") != null) document.all("EndDate").value="";
if (document.all("dlCategory") != null) document.all("dlCategory").item( 0 ).selected = true;
if (document.all("dlApproval") != null) document.all("dlApproval").item( 0 ).selected = true;
if (document.all("dlDocStatus") != null) document.all("dlDocStatus").item( 0 ).selected = true;
if (document.all("xdlAddByxx") != null) document.all("dlAddBy").item( 0 ).selected = true;
if (document.all("dlEditor") != null) document.all("dlEditor").item( 0 ).selected = true;
if (document.all("dlNewsTarget") != null) document.all("dlNewsTarget").item( 0 ).selected = true;
}
</script>