i want to make an object which can do all the actions my form needs -- it can validate the form, submit the form, and so forth. i want javascript to do all these things. i no longer want to write same code several times over in procedural fashion javascript in global namespace. i want to create Javascript object to handle these functions of the form and i want to have everything live in a namespace to avoid conflicts.
i have hard time to understand how javascript OO works compared to other language with classical inheritance vs prototype inheritance. can somebody show me how to create a class, and then instantiate 2 objects of that class and bind each of them to two identical form on the same page?
i look at module pattern but it seems for singleton only.
thanks if anybody can help