<form name="form1" method="post" action="">
<input type="text" name="name" size="20"
value="Sally Jones">
<This is the text field.<br>
<input type="button" name="button1" value="Display
the contents at the end of this page."
onclick="document.writeln('<p>' + document.form1.name.value + '</p>');"><br>
<input type="button" name="button2" value="Change
the contents to Sam Houston."
onclick="
if (document.form1.button2.value=='Change the contents to Sam Houston.')
{document.form1.name.value = 'Sam Houston';
document.form1.button2.value='Change the contents to Sally Jones.';}
else
{document.form1.name.value = 'Sally Jones';
document.form1.button2.value='Change the contents to Sam Houston.';}">
<p>(After the contents is written and displayed, refresh/reload the Web
page to return.)</p>
</form>