I have two text boxes in a Webpage,
Is it possible that If a user types a data in the first text box, it automatically appears the same data in the 2nd textbox?
Please help!
thanks in advance.
Printable View
I have two text boxes in a Webpage,
Is it possible that If a user types a data in the first text box, it automatically appears the same data in the 2nd textbox?
Please help!
thanks in advance.
you'll need to have some kind of event that activates the copying of the text like a button.
you can do it on the client side or server side...client would be better if you want it instantly.
something like this
Code:<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script>
function CopyText()
{
if(form1.text1.value != "") {
form1.text2.value = form1.text1.value
}
}
</script>
</head>
<body>
<form name="form1" method="post" action="">
Text1: <input type="text" name="text1"><br><br>
Text2: <input type="text" name="text2"><br><br>
<input name="submit" type="button" value="submit" onClick="CopyText();">
</form>
</body>
</html>
Thanks a lot!
Memnoch1207 for your help
Thank you!