The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Hybrid View

Weid behaviour calling value of a selfmade JS class

Hi,

I experienced some weird behaviour when alerting the value of a selfmade JS class.

I made the class myTestobj with one property called 'value'. The object 'mytest' is of that type. If I alert 'mytest.value' before the formtag it says 'Normal behaviour' as expected. But when I alert it inside the form it says 'Not so normal behaviour!'.

As you can see I have an element with the name 'mytest' in the form.
Why does it alert the value of this element when I call it inside the form and not the value of my object?

Go through your js and your html and write down every variable name you use and every name you assigned to a name attribute. Create columns for each name, and put tick marks under the column headings every time you use a name. Also add an extra tick mark under "value" since js uses that name as well.