asp.net中的文本框最大长度 [英] textbox maximum length in asp.net

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

问题描述

嗨专家,



在我的网页上我有文本框输入信息。



我将MobileNo文本框作为TxtMobileNo,用户将进入mobileno。它将最大长度设置为10.



如果用户输入10个数字并按任意键,则光标必须转到另一个文本框。



就是这样。



帮我谢谢。

Hi experts,

on my webpage i have Textboxes to enter the information.

I have a Textbox with MobileNo as TxtMobileNo, In this the user will enter mobileno. it has set Maximum length to 10.

if the user enters 10 numbers and press on any key the cursor must go the other textbox.

thats it.

help me thanks.

推荐答案

你必须处理文本框的按键事件。



you have to handle keypress event of the textbox.


' #txtPhoneNumber')。keyPress( function (){
if
('#txtPhoneNumber').keyPress(function() { if(


this )。val( ).length == 10 ){
(this).val().length == 10) {


这篇关于asp.net中的文本框最大长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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