nivla
07-01-2005, 02:27 AM
Hi,
I'm encountering some problem with Form object.
I have a form named KPIIN. In the form,
I'm having 2 input field with type=text in the body.
I gave the first textbox name=txtinput, id=txt1
and the second textbox name=txtinput, id=txt2.
In my body tag, I have onload=loodcookie() function.
And in my function, I just want to alert a single line
with
alert(KPIIN.txtinput.length)
So, when I run my page, I will received a popup returning
2, which is the number of element in my body page. This is
fine.
However, when I take out one of the textbox and leave
only a single textbox, this alert message return "Undefined"
Should it returns "1"?
Any help is greatly appreciated. Thanks in advance.
I'm encountering some problem with Form object.
I have a form named KPIIN. In the form,
I'm having 2 input field with type=text in the body.
I gave the first textbox name=txtinput, id=txt1
and the second textbox name=txtinput, id=txt2.
In my body tag, I have onload=loodcookie() function.
And in my function, I just want to alert a single line
with
alert(KPIIN.txtinput.length)
So, when I run my page, I will received a popup returning
2, which is the number of element in my body page. This is
fine.
However, when I take out one of the textbox and leave
only a single textbox, this alert message return "Undefined"
Should it returns "1"?
Any help is greatly appreciated. Thanks in advance.