Making stuff as a founder of Avocado. Former music-maker. Tuna melt advocate. Started Google Reader. (But smarter people made it great.)

Extending Your Forms

For the googolth time, I've been asked to retrieve form values and generate client-side validation after a user has changed some page information on-the-fly.

I like this type of feature. To me it seems user-helpful and I feel it makes forms more usable, particularly complex ones.

But - I've done it so many times before. And, clearly, I'm sooo lazy.

So, I wrapped up the kitchen sink into an object in Javascript, made some getter and setters, and made it extensible.

An ExtendedForm class.

(See the example.)

Please, go visit. Use it as often as you like. It's free. And it includes a single method which allows it to check whether or not any changes have been made to the form before submitting.

Other things I like about it include:

  1. I no longer have to write methods figuring out how to get values from radio buttons and drop-downs. It knows for me.
  2. The object can be extended to support application-level validation methods.
  3. I don't have to worry if the <form> fields have NAME or ID attributes. If it can't find one, it'll look for the other.
  4. By developing a very tiny API it makes it easier to integrate within existing architectures and manage element-access methods so they conform to web standards.

It's pretty great! Though, not perfect. Like you.

Oh - I'm afraid I might sing "Man in the Mirror" to all of you.

Again.

Posted at September 3, 2003 02:05 PM
Main | massless.org continued... >>
"The dark neighborhoods"

Comments

wow, thanks i am going to try your code, i'm glad i stopped at your blog

Posted by: c0d3gr1 at September 11, 2003 09:06 PM


«·´`·.(*·.¸(`·.¸ ¸.·´)¸.·*).·´`·»
«·´¨*·.¸¸.*Aiya meldonya!!*.¸¸.·*¨`·»
«·´`·.(¸.·´(¸.·* *·.¸)`·.¸).·´`·»

~Essenya ná Lúthien~

A Elentári Tintalle
silmarin penda mírea
menello alcar eldion!
Haiyanna palantírina
aldarembie endorillor
Fanoiolosse, len linduvan
nive ear, simen nive earon!


^^^^^^^^^#####^^^^^^^^^^#####^^^^^^^^^^
^^^^^^^#########^^^^^^#########^^^^^^^^
^^^^^^############^^############^^^^^^^
^^^^^############################^^^^^^
^^^^^############################^^^^^^
^^^^^############################^^^^^^
^^^^^^##########################^^^^^^^
^^^^^^^########################^^^^^^^^
^^^^^^^^^####################^^^^^^^^^^
^^^^^^^^^^^################^^^^^^^^^^^^
^^^^^^^^^^^^^############^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^########^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^####^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^##^^^^^^^^^^^^^^^^^^^

«·´`·.(*·.¸(`·.¸ ¸.·´)¸.·*).·´`·»
«·´¨*·.¸¸.*Namárië*.¸¸.·*¨`·»
«·´`·.(¸.·´(¸.·* *·.¸)`·.¸).·´`·»

Posted by: _Elentari_ at October 17, 2003 07:40 AM

Post a comment










Remember personal info?