How do I insert a char into the textfield on the keypress event of another textfield?
I have two textboxes, "text1" and "text2".
[COLOR=DarkRed]Important:[/COLOR]
"text1" is outside the table.
"text2" is inside the table cell.
On the keydown/keypress/keyup event of "text1", the character which I entered in the "text1" must display in the textfield "text2".
Sample Code:
[HTML]<input type="text" name="text1" onkeypress="write(this)">
<table> //This is a dynamically generated table
<tr>
<td><input type="text" name="text2"></td>
</tr>
</table>
[/HTML]
For example,
Suppose If I enter srsh in "text1", "text2" should display the same.
At the same time, If I enter 'u' in between 's' and 'r' and 'e' in between 'r' and the second 's' in "text1", "text2" should now display "suresh".
And I want to know one more thing?
How can I get the position of the cursor of the textfield "text1"?
How can I set the position of the cursor of the textfield "text2"?
Can anyone please help me?
Regards,
Suresh.