textfield maxlength [英] textfield maxlength

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

问题描述

大家好!希望你能帮助我????


< input type =" text"名称= QUOT; txtSerialNo" id =" txtSerialNo" maxlength =" 20">

varType = document.crmForm.txtType.value;


if(varType ==" SERIAL"){


document.crmForm.txtSerialNo.value.length =" 15"


}否则if(varType ==" MIN") {


document.crmForm.txtSerialNo.length =''10'';

}


但是txtSerialNo保持其原始长度..

即时设置txtSerial防御的最大长度if语句中的条件..

希望你能帮助我...谢谢!

解决方案


嗨伙计们!希望你能帮助我????


< input type =" text"名称= QUOT; txtSerialNo" id =" txtSerialNo" maxlength =" 20">

varType = document.crmForm.txtType.value;


if(varType ==" SERIAL"){


document.crmForm.txtSerialNo.value.length =" 15"


}否则if(varType ==" MIN") {


document.crmForm.txtSerialNo.length =''10'';

}


但是txtSerialNo保持其原始长度..

即时设置txtSerial防御的最大长度if语句中的条件..

希望你能帮助我...谢谢!



使用.....设置maxlength

展开 | 选择 | 换行 | 行号

< br>


使用.....设置maxlength

展开 | 选择 | Wrap | 行号



document.crmForm.txtSerialNo.setAttribute(''maxleng th'')=" 10";



ouuuuccchhh ......它没有工作:-(


感谢您的回复...


你给了maxlength的空格。

检查一下。

好​​运;


亲切的问候,

Dmjpro。


hi guys!! hope you cam help me????

<input type="text" name="txtSerialNo" id= "txtSerialNo" maxlength="20">
varType = document.crmForm.txtType.value;

if (varType == "SERIAL") {

document.crmForm.txtSerialNo.value.length = "15";

} else if (varType == "MIN"){

document.crmForm.txtSerialNo.length = ''10'';
}

But the txtSerialNo remains in its original length..
im wat to set the maxlength of the txtSerial defending in the condition in if statement..
Hope you can help me...thanks!

解决方案

hi guys!! hope you cam help me????

<input type="text" name="txtSerialNo" id= "txtSerialNo" maxlength="20">
varType = document.crmForm.txtType.value;

if (varType == "SERIAL") {

document.crmForm.txtSerialNo.value.length = "15";

} else if (varType == "MIN"){

document.crmForm.txtSerialNo.length = ''10'';
}

But the txtSerialNo remains in its original length..
im wat to set the maxlength of the txtSerial defending in the condition in if statement..
Hope you can help me...thanks!


Set the maxlength using .....

Expand|Select|Wrap|Line Numbers


Set the maxlength using .....

Expand|Select|Wrap|Line Numbers


document.crmForm.txtSerialNo.setAttribute(''maxleng th'') = "10";


ouuuuccchhh...it didn''t work :-(

thanks for the reply...

Did u give a space in maxlength.
Check it.
Best of luck;

Kind regards,
Dmjpro.


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

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