如何在asp.net中触发textchange或keypress事件 [英] how to fire textchange or keypress event in asp.net
本文介绍了如何在asp.net中触发textchange或keypress事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有三个文本框..
如果我更改了Textbox1中的文本,则在Textbox1发生textchange事件或按键事件时,我想在textbox2和textbox3中进行更改.
解决方案
文本更改事件
< html > ; < 头部 > < 标题 > < /title > < /head > < 正文 > < 输入 =" Text1" 类型 文本" onchange =" 警报(this.value)" / > < /body > < /html >
按键事件
<input id="Text1" type="text" onkeypress="alert(this.value)" />
谢谢
SP
您可以使用jquery ...
< html > ; < 头部 > < 脚本 =" http://code.jquery.com/jquery-latest. js" < / 脚本 > < 脚本 >
(文档).ready( function (){
i have three Textboxes ..
if i change the text in Textbox1 then on textchange event or keypress event of Textbox1 i want to make changes in textbox2 and textbox3.
解决方案
Text change event
<html> <head> <title></title> </head> <body> <input id="Text1" type="text" onchange="alert(this.value)" /> </body> </html>
Key press event
<input id="Text1" type="text" onkeypress="alert(this.value)" />
Thanks
SP
Hi,
You can use jquery...
<html> <head> <script src="http://code.jquery.com/jquery-latest.js"></script> <script>
(document).ready(function () {
这篇关于如何在asp.net中触发textchange或keypress事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文