Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text box and array

Status
Not open for further replies.

lostnewbie

Programmer
Nov 6, 2002
5
US
I have a text box to answer my question and I was wondering how can I use array to check for the right answer in the textbox?
 
Why are you trying to use an array?

<script>
function checkAns(){
if (document.myForm.Q1.value != &quot;Correct Answer&quot;){
alert (document.myForm.Q1.value + &quot; is the wrong answer!&quot;)
document.myForm.Q1.value = &quot;&quot;
document.myForm.Q1.focus()
//they are going to hate looping 'til they get the right answer.....
}
}
</script>


<input type=text name=&quot;Q1&quot; onBlur=&quot;checkAns()&quot;>


If you are trying to use an array to check an entire form check out thread216-406724 -- Just trying to help...
[wolf]<--- This is a wolf? We need a new icon.......
mikewolf@tst-us.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top