[thelist] JAVASCRIPT: realtime update of input fields in a form

Tom Dell'Aringa pixelmech at yahoo.com
Mon Jul 1 19:10:01 CDT 2002


Chris, that article may be too much for you if you are new to
Javascript, so here is something quick and dirty for you to start
with. Its probably IE dependent. But it will give you an idea maybe
of where to start.

All it does is use the onkeypress event, it waits for 5 seconds and
then starts copying the content over. It should be "live" as it were.
But adding in formatting should be fun..

If I can work on it some more I will.

-----

<html>
<head>
	<title>Untitled</title>
<script>
function change2()
{
mycontent = document.getElementById("blah1").value;
document.getElementById("blah2").value = mycontent;
}

function change()
{
	setTimeout("change2()", 5000);
}
</script>
</head>

<body>
<form name="foo">
<textarea cols="12" rows="12" id="blah1"
onkeypress="change()"></textarea>

<textarea cols="12" rows="12" id="blah2"></textarea>
</form>

</body>
</html>

--------

Tom

=====
var me = tom.pixelmech.webDeveloper();
http://www.pixelmech.com/

__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com



More information about the thelist mailing list