Click here to Skip to main content
15,891,864 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
Posted

Text change event
XML
<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
 
Share this answer
 
Hi,

You can use jquery...
HTML
<html>
<head>
	<script src="http://code.jquery.com/jquery-latest.js"></script>
	<script>
	
	$(document).ready(function () {
		$("#text1").keypress(function() {
			var text1Value = $("#text1").val();
			$("#text2").val(text1Value);
			$("#text3").val(text1Value);
		});
	});
	
	</script>
</head>
<body>
	<form>
	  <fieldset>
		<input id="text1" type="text" value="1" />
		<input id="text2" type="text" value="2" />
		<input id="text3" type="text" value="3" />
	  </fieldset>
	</form>
</body>
</html>
 
Share this answer
 
v2
use ajax for this it will be easy and secure
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900