Click to See Complete Forum and Search --> : script to check response
handlin
11-03-2003, 01:41 PM
I am new to this list so apologize for asking something that may be old hat to all of you. I need to check a typed in response and either accept it or reject it. I think I have done it before, but cannot remember how it was done. I use Java scripts but do not write them.
Thank you.
What exactly do you mean? Using artificial intelligence to respond to a block of text someone enters into a text field, or check to see if some pattern or combination thereof exists and respond according to whether or not it was found?
[J]ona
handlin
11-03-2003, 03:57 PM
I want students to identify a muscle or organ and enter the correctly spelled name. It must be exactly right or it is wrong. I am not scoring, just responding.
<form action="" name="frm"><div>
<input type="text" name="muscle"><br>
<input type="button" onclick="if(this.form.muscle.value != 'the exact name of the muscle'){ alert('Incorrect'); } else {alert('Correct'); }" value="Test">
</div></form>
[J]ona
fredmv
11-03-2003, 04:42 PM
<input type="text" onblur="alert((this.value.toLowerCase() == 'muscle') ? 'Correct.' : 'Incorrect.');" />
handlin
11-03-2003, 05:22 PM
That looks like it will do what I need. I will insert it tomorrow and see what I can do with it. I'm sure you know how much time and effort you ahve saved me! (Plus the greay hairs...) Thank you. I will report back.