可以..用正则来判断textbox1的输入.
然后在输入完后用失去焦点来赋值给textbox2和textbox3.
textbox2和textbox3的值可以任意改变
然后在输入完后用失去焦点来赋值给textbox2和textbox3.
textbox2和textbox3的值可以任意改变
解决方案 »
- [奇怪的问题]asp.net一般处理程序ashx,写入session,aspx页里获取不到!
- 急!!!用WebbUpload上传文件在 iis7 没有反应
- response.redirect 中想实现 target
- 请问一下怎么样在配置文件中写应用程序和数据库不在同一台服务器上的连接语句?
- 点GridView分页时出错,请高手指点
- RichTextBox控件的几个问题
- 请问如何知道一张网页是什么时候发表的,谢谢
- 各位﹐如何調出DTpicker控件的值啊?
- 大家都是在什么地方申请域名?
- 如何从.cs文件中调到含数到<a href="#" onClikc=""></a>中
- 搜索后的查询结果如何用Table+Label实现!
- 在gridview 添加一个CheckBox模板列,希望选取checkBox 时,激发一个事件,如何做,谢谢
2.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
TextBox1.Attributes.Add("onpropertychange", "ChangeValue()") '这个就是调用js
End Sub<script >
function ChangeValue(){
var Value1=document .getElementById ("TextBox1").value;
document .getElementById ("TextBox2").value=Value1.substring(0,5);
document .getElementById ("TextBox3").value=Value1 .substring(10,15);
//这里就是你用来控制的js
}
</script>
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server" onchange="checkLength()"></asp:TextBox>
<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
<asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
</div>
</form>
</body>
</html>
<script language="javascript" type="text/javascript">
function checkLength()
{
var temp;
var t1=document.getElementById("TextBox1").value;
var t2=document.getElementById("TextBox2").value;
var t3=document.getElementById("TextBox3").value;
if(t1.length==15)
{
document.getElementById("TextBox2").value=t1.substring(0,5);
document.getElementById("TextBox3").value=t1.substring(10,15);
}
}
</script>具体细节自己处理
同意7楼的,用TextChange方法!