form2js
form2js copied to clipboard
feature request: jquery!
I'd love to be able to use a jquery selector as a rootNode.
Check out jquery.toObject.js & jquery.example.html
ok... just used .get(0) and that was enough for me. still though, i'd love to see your whole plugin re-done as a jquery function... it'd be easier to deal with...
Man, I'm saying there's jquery plugin already.
<script src="jquery.min.js"></script>
<script src="form2js.js"></script>
<script src="jquery.toObject.js"></script>
<script>
// no .get(0)
var formData = $('any selector').toObject();
</script>
Yea, but I don't need to include your whole plugin when .get(0) works well enough with a few lines of coffeescript...
# small wrapper to work with jquery
form2js: (node) ->
form2js(node.get(0), '.', false)
js2form: (node, obj) ->
js2form(node.get(0), obj)