Opened 14 years ago

Closed 12 years ago

#512 closed enhancement (wontfix)

[patch][need cla] make encodeForm use per-type serialization functions

Reported by: ningu Owned by: James Burke
Priority: high Milestone: 0.9
Component: General Version: 0.3
Keywords: Cc:
Blocked By: Blocking:

Description

In my applications I use XMLHTTP-submitted forms frequently, but I prefer to make one small change to how the params are normally submitted -- I make checkboxes always submit 1 or 0, which simplifies handling them on the server end. There is no single thing to override in dojo to create this behavior. I've made a small patch to do so. encodeForm() now chooses its appropriate serializer from dojo.io.formEncodeSerializer[type]. This also allows further customization of form submissions if there is e.g. something special about how you want to handle select-one, or whatever. I've left the image stuff the same cause I wasn't sure what to do with it.

Attachments (1)

diff.txt (1.4 KB) - added by ningu 14 years ago.

Download all attachments as: .zip

Change History (11)

Changed 14 years ago by ningu

Attachment: diff.txt added

comment:1 Changed 14 years ago by anonymous

Milestone: 0.3release

hi ningu, do we have a CLA on file for you?

If not, would you mind filling one out? http://dojotoolkit.org/icla.txt

Regards

comment:2 Changed 13 years ago by Dustin Machi

Milestone: 0.3release0.4

comment:3 Changed 13 years ago by dylan

No CLA on file as far as I can tell, so we can't merge this patch.

comment:4 Changed 13 years ago by dylan

Summary: make encodeForm use per-type serialization functions[patch][needs cla] make encodeForm use per-type serialization functions

Pushing to next release because we still haven't received a response to our CLA requirement.

comment:5 Changed 13 years ago by dylan

Summary: [patch][needs cla] make encodeForm use per-type serialization functions[patch][need cla] make encodeForm use per-type serialization functions

comment:6 Changed 13 years ago by dylan

Owner: changed from anonymous to alex

comment:7 Changed 13 years ago by jkuhnert

Owner: changed from alex to jkuhnert
Status: newassigned

comment:8 Changed 13 years ago by dylan

Milestone: 0.40.5

no cla yet, and out of time for 0.4

comment:9 Changed 13 years ago by jkuhnert

Owner: changed from jkuhnert to James Burke
Status: assignednew

Re-assigning to james for a minimum of at least getting his thoughts on how this should be handled.

Besides not the not having a cla part, do you even want to see formbind go in this direction?

comment:10 Changed 12 years ago by James Burke

Resolution: wontfix
Status: newclosed

No CLA, and there is no form bind in 0.9. Closing this as wontfix since the approach has changed in 0.9.

There is dojo.formToObject, which I do not think should allow special serializers, but instead, use dojo.formToObject to get a JS object representing form values, then you can manipulate that object however you want before serializing.

Note: See TracTickets for help on using tickets.