如何对基于其他文本框的文本框执行验证? [英] How to perform validation for a textbox based on other textbox?

查看:90
本文介绍了如何对基于其他文本框的文本框执行验证?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我正在使用3个文本框,允许用户选择不同的范围.我想对三个文本框执行以下验证.

1.用户应在第一个文本框中输入一个值(即有效数字,不允许输入零,十进制数和负数).

2.第二个文本框的值应大于第一个文本框.

3.第三文本框的值应大于第二文本框.



我只想使用JavaScript在客户端执行验证.如果出现任何问题,我想填充一个消息框.

我该怎么办?



问候,

NSJ

Hi All,

I''m using 3 text boxes for allowing user selecting different ranges. I want to perform below validations on three text boxes.

1.User should enter a value (i.e. a valid number,doesn''t allow to enter zero,decimal numbers and negative numbers) in 1st text box.

2. 2nd text box value should be greater than 1st text box.

3. 3rd text box value should be greater than 2nd text box.



I want to perform validations on client side only using JavaScript. If anything goes wrong I want to populate a message box.

How can I do this?



Regards,

NSJ

推荐答案

为什么要尝试编写自己的JavaScript,其中ASP.NET提供了所需的所有内置验证.
验证ASP.NET服务器控件
[ ^ ]
Why you are trying to write your own javascript where ASP.NET Provides all the Inbuilt validation which you have required.
Validating ASP.NET Server Controls
[^]


您应该在这里开始: http://tinyurl.com/63oh77g [ ^ ]
Here''s where you should have started: http://tinyurl.com/63oh77g[^]


这篇关于如何对基于其他文本框的文本框执行验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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