Cascade update of input text boxes
I have 3 input text elements:
- <html>
- <head>
- <title></title>
- <script type="text/javascript" src="../lib/jquery/jquery.js"></script>
- <script type="text/javascript">
- $(document).ready(function()
- {
- $("#text1").keyup(function() {
- $("#text2").val($(this).val());
- return true;
- });
- });
- </script>
- </head>
- <body>
- <p>Text1: <input type="text" name="text1" id="text1"/></p>
- <p>Text2: <input type="text" name="text2" id="text2"/></p>
- <p>Text3: <input type="text" name="text3" id="text3"/></p>
- </body>
- </html>
When user inputs text to "text1" I want to reflect changes in "text2". When value is changed in "text2" I want to change value in "text3". So I handle keyup event in "text1" and then successfully update "text2". But which event need to be handled when value of "text2" is changed?
Important remarks:
1. I don't want to update "text3" from "text1".keyup event. My goal is to handle some event when value in "text2" is changed(may be by user or may be by code)
2. "text3" needs to be changed immediately after "text2".value changed