文字框问题 [英] Text Box Problem

查看:109
本文介绍了文字框问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我使用了一个文本框,其Textmode属性为MultiLine且MaxLength为255.

但是文本框最多不能验证255.
有什么问题吗?

谁能解决这个问题

Hi All,

I used a textbox whose Textmode property is MultiLine and MaxLength is 255.

But the text box could not validate up to 255.
What''s the problem?

Can Anybody Solve that

推荐答案



对于多文本框"属性,最大长度将不起作用.
为此,您需要编写自己的javascript函数以验证
文本框的最大长度.

Hi,

For Multi Textbox property,max length will not work.
For that you need to write your own javascript function to validate the
max length of textbox.

function validate(obj)
{
  if(obj.value.length > 255)
  {
    alert("give proper mess here");
    return false;
  }
}



在文本框的onkeypress事件中调用上述函数,如下所示
onkeypress ="javascript:return validate(this);"

Regadrs,
Kiran.



call the above function in the onkeypress event of your textbox as follows
onkeypress="javascript:return validate(this);"

Regadrs,
Kiran.


仅当文本之间至少有空格时,多行文本框才能验证最大长度,
最好编写自己的JavaScript并在按键或焦点上触发它.
Multiline text boxes could only validate max length if text have at least on space in between,
better write your own javascript and fire it on key press or focus out .


在此处检查
check here http://www.codeproject.com/Questions/130771/copy-paste.aspx for the javascript.


这篇关于文字框问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆