在vb.net中验证Pan Card [英] Validation for pan card in vb.net

查看:68
本文介绍了在vb.net中验证Pan Card的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想在vb.net中编写用于验证Pan Card的代码.
请为此提供帮助.

Hi,
I want to code for validation of pan card in vb.net.
Please help me for this.

推荐答案

尝试以下操作:
在head部分下的aspx页面中编写以下javascript函数:
Try this:
Write the below javascript function in the aspx page under head section :
<script type="text/javascript">
function Validation()
{
var a=document.getElementById('TextBox1').value;

var regex1=/^[A-Z]{5}\d{4}[A-Z]{1}


/; // 这是常规展示的模式 如果(regex1.test(a)== false ) { alert(' 请输入有效的pan号'); 返回 ; } } </script>
/; //this is the pattern of regular expersion if(regex1.test(a)== false) { alert('Please enter valid pan number'); return false; } } </script>


在.aspx页面的正文"部分中,只需将按钮的onClientclick事件绑定到javascript中的上述函数即可检查TextBox1的值.

在页面上使用一个texbox和按钮控件,如下所示:


In the Body Section of the .aspx page just bind the onClientclick event of the button to the function above in the javascript to check the value of TextBox1

Take one texbox and button control on the page as shown below:

<asp:textbox id="TextBox1" runat="server" xmlns:asp="#unknown"></asp:textbox>
<asp:button id="Button1" runat="server" text="Button" onclientclick="javascript:return Validation();" xmlns:asp="#unknown" />


这篇关于在vb.net中验证Pan Card的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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