Probably a simple question for most people, I couldn't find it documented anywhere. Simply, what I want is a text box where people write an answer to a question, a submit button that has an onClick javascript function, and then it will answer "Right" or "Wrong". Here's so far:
I am most certainly doing something wrong as I haven't used JS in a while... some help is appreciated, thanks.
Code:
<form name="form1"><input type="text" name="input1"><input type="Submit" onClick="submit()">
<script language="JavaScript">
function submit()
{
if (document.testform.a == guess)
{
document.form1.input1.value=Correct;
}
else
{
document.form1.input1.value=Wrong;
}
}
</script>
I am most certainly doing something wrong as I haven't used JS in a while... some help is appreciated, thanks.