AJ ONeal wrote:
> forms are to javascript what tables are to ruby
> 
> I need something that will map html forms to json objects (easily 
> configured for arbitrary formats a plus).
> Does such a thing exist?

Try the Prototype framework (http://www.prototypejs.org/). If you're 
doing anything non-trivial (read: at all interesting) you should really 
be using Prototype or something like it. Prototype is definitely *not* 
an ORM layer, but it does what you seem to be asking about and is worth 
a look anyway.

> If not I was thinking some crazy regex-loop-foo might work.
> 
> i.e. 
> something like this
> <input name='question[id]' ...
> <input name='question[text]' ...
> <input name='question[user[email]]' ...
> becomes something like this
> { question : {
>     id = 1,
>     text = 'text',
>     users: { 
>       email: '[email protected] <mailto:[email protected]>' 
>     }
>   }
> }
> 
> following the "Hijax" pattern

Prototype's Form.serialize() might be what you're looking for, but I'm 
not sure how it handles input arrays.

> It would probably be much easier to do that in reverse, but I want the 
> forms to degrade gracefully... I don't know why I want the forms to 
> degrade gracefully because I, in fact, am racist against people who 
> don't use javascript... but it's what I think I want.

I hate bigots.

-Brent
--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
___________________________________________________________________
List Info (unsubscribe here): http://uug.byu.edu/mailman/listinfo/uug-list

Reply via email to