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

Chris W. Parker cparker at swatgear.com
Tue Jul 2 11:44:01 CDT 2002


> -----Original Message-----
> From: Tom Dell'Aringa [mailto:pixelmech at yahoo.com]
> Sent: Monday, July 01, 2002 5:14 PM
>
> 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>

woh thanks! that's exactly what i was looking for. and so easy too! now
i can just integrate the formatting buttons and regex stuff from the
other post.

thanks for all your help. you did a good job!


chris.



More information about the thelist mailing list