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

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


Yikes, okay sorry for the quick posts - but Chris, this MIGHT be
exactly what you are looking for and I did it by accident.

If you write the innerHTML to a DIV, *IT FORMATS IT FOR YOU!* I did a
bold tag for kicks and smack my panty, it wrote it out bold. It also
handled the P tag and <i> ...check it out. IE only unless you really
work at it.

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

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

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

<div id="blah2" style="width: 100; height: 100;"></div>


</form>

</body>
</html>

=====
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