# Array and Trace problem

**URL:** <https://forum.kirupa.com/t/array-and-trace-problem/139905>\
**Category:** Uncategorized\
**Created:** [March 6, 2005, 10:01pm UTC](https://forum.kirupa.com/t/array-and-trace-problem/139905 "2005-03-06T22:01:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![yossarian](https://avatars.discourse-cdn.com/v4/letter/y/9de0a6/32.png) [@yossarian](https://forum.kirupa.com/u/yossarian)\
**Post date:** [March 6, 2005, 10:01pm UTC](https://forum.kirupa.com/t/array-and-trace-problem/139905/1 "2005-03-06T22:01:51Z")

</div>

I got 4 input txt boxes and this little code but I can’t seem to get it right! When I type in the “a” it still traces False… how can that be?

Any idea how I can change the script so that I get a message saying \*Correct Answer \*(if all are correct) and \*Some of your answer are incorrect (if some are…)

- 

```auto
question_count = 4;
right_answers = ["[color=#0000ff]a[/color]", "[color=#0000ff]b[/color]", "[color=#0000ff]c[/color]", "[color=#0000ff]d[/color]"];
[color=#000084]function[/color] checkAnswers() {
        result = [color=#000084]true[/color];
        [color=#000084]for[/color] (i=0; i<question_count; i++) {
                [color=#000084]if[/color] ([color=#000084]_root[/color]["[color=#0000ff]input[/color]"+(i+1)].[color=#000084]text[/color] != right_answers*) {
                        result = [color=#000084]false[/color];
                }
        }
        [color=#000084]return[/color] result;
}
check_button.[color=#000084]onRelease[/color] = [color=#000084]function[/color]() {
        [color=#000084]trace[/color](checkAnswers());
};

```

Clue?

Yossi
