首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

对象不支持此属性或方法? 求救?解决方案

2012-02-07 
对象不支持此属性或方法? 求救?我在页面中做验证functioncheckforms(){if(document.Login.txSend.value.tr

对象不支持此属性或方法? 求救?
我  
  在     页面中做验证

function     checkforms()
  {  
      if(document.Login.txSend.value.trim()== " ")
    {
          alert( '收件人不能为空 ');
  document.Login.txSend.focus();
  return   false;
    }

然后写

  <form   id= "Login "     name= "Login "   runat= "server "     method= "post "     onsubmit= "return   checkforms(); ">

怎么验证   不起作用?   老是提示   对象不支持此属性或方法?

我的   是ASP.NET   2.0   ,以前   1.1的时候   可没出现问题,

求救?

[解决办法]

trim()??
javascript有这个方法?
那就佩服了
[解决办法]
应该是.length吧
[解决办法]
没见过JS有TRIM()这个方法啊
[解决办法]
javascript没有Trim()真个方法吧!要截字符串都是通过特殊处理的
[解决办法]
try

function checkforms()
{
if(document.Login.txSend.value.replace(/(^\s*)|(\s*$)/g, " ")== " ")
{
alert( '收件人不能为空 ');
document.Login.txSend.focus();
return false;
}

热点排行