Autoanswering text fields  
 
This is a collection of scripts that may be used for building interactive courseware. You can use the scripts for free. However, we would apreciate if you could mention the source in the acknowledgements.  
Autoanswering text fields
prompt the user with the correct answer when the button is pressed.
Example 
What is the most abundant atom in silicates?
What is the most abundant cation in silicates?
The source 
<table>
<FORM>

<TR VALIGN=CENTER>
<TD><FORM></TD>
<TD valign=center><B><FONT FACE="helvetica"></B> <B>
What is the most abundant atom in silicates?</FONT></B></TD>
<TD VALIGN=CENTER><INPUT type=text name=field1 size=25 onFocus="this.form.field1.value=''"></TD>
<TD valign=center><INPUT type=button value="Correct?" onClick="if(this.form.field1.value.toUpperCase()=='O'){this.form.field1.value=this.form.field1.value.toUpperCase()+' was correct!';}else{this.form.field1.value='Input >' + this.form.field1.value+'< was wrong!';}"></TD>
</FORM>
</TR>

<TR VALIGN=CENTER>
<TD><FORM></TD>
<TD valign=center><B><FONT FACE="helvetica"></B> <B>
What is the most abundant cation in silicates?</FONT></B></TD>
<TD VALIGN=CENTER><INPUT type=text name=field1 size=25 onFocus="this.form.field1.value=''"></TD>
<TD valign=center><INPUT type=button value="Correct?" onClick="if(this.form.field1.value.toUpperCase()=='SI'){this.form.field1.value=this.form.field1.value.toUpperCase()+' was correct!';}else{this.form.field1.value='Input >' + this.form.field1.value+'< was wrong!';}"></TD>
</FORM>
</TR>

</table>
 

 

Stefan Krumm  
Institut für Geologie, Schloßgarten 5, 91054 Erlangen  
krumm@geol.uni-erlangen.de