我无法调用名为 clear 的 javascript 函数,该函数接受一个字符串参数,即我通过在客户端单击时调用该函数传递的参数值。这是我的代码,请帮助我
<script type="text/javascript">
var _whichform = 'login'
function clear(_whichform)
{
switch (_whichform)
{
case 'login':
document.getElementById('<%=tbxUsername.ClientID%>').value = ''
document.getElementById('<%=tbxPassword.ClientID%>').value = ''
document.getElementById('<%=tbxFname.ClientID%>').value = ''
document.getElementById('<%=tbxLname.ClientID%>').value = ''
break;
break;
case 'company':
document.getElementById('<%=tbxCompname.ClientID%>').value = ''
document.getElementById('<%=tbxDescptn.ClientID%>').value = ''
document.getElementById('<%=tbxCompanyEmail.ClientID%>').value = ''
document.getElementById('<%=tbxStateCo.ClientID%>').value = ''
document.getElementById('<%=tbxStateCo.ClientID%>').value = ''
document.getElementById('<%=tbxCity.ClientID%>').value = ''
document.getElementById('<%=tbxCompanyAddress.ClientID%>').value = ''
document.getElementById('<%=tbxCpCountryCode.ClientID%>').value = ''
document.getElementById('<%=tbxCpStateCode.ClientID%>').value = ''
document.getElementById('<%=tbxPhone.ClientID%>').value = ''
document.getElementById('<%=tbxCfCountryCode.ClientID%>').value = ''
document.getElementById('<%=tbxCfStateCode.ClientID%>').value = ''
document.getElementById('<%=tbxCffax.ClientID%>').value = ''
break;
}
}
</script>
<input id="btnLoginCancel" type="button" value="Clear" onclick="clear('login')" class="buttons"/>