What's wrong with this picture?

Can anyone tell me why this code is acting like this? I’m using VS 2010. There are a ton of other functions in this library that use the .indexOf() object with no problems. I don’t know what I’m doing wrong here. I’ve research the .indexOf() object and I’m using it as I’ve seen used in book and online examples.

Please see attached GIF Image.

Thanks,

What’s going wrong is that you are trying to use it on an element, when it should be used on a string or (if using JavaScript v1.6 or better) on arrays.

Paul,

I’m not real good with Javascript. Something I tried and still didn’t work was when I declared the variable “result”, I redid the statement like this:

var result = “”;

What should it be?

From what you’re doing with the num1 variable, it seems that it should be the value of the field, rather than a reference to the field itself.