Opened 14 years ago

Closed 14 years ago

Last modified 14 years ago

#352 closed enhancement (fixed)

Add form node filtering support to bind

Reported by: david Owned by: io form
Priority: high Milestone:
Component: General Version: 0.2
Keywords: Cc:
Blocked By: Blocking:

Description

Add the ability to filter values from forms submitted with bind. This is useful when you have mulitiple submit buttons (I think we skip all of them right now) as well as other buttons (including image buttons); we send all buttons+values right now. The following example would implement the current behavior with a filter function:

// filterFunc would get passed to dojo.io.encodeForm
function filterFunc(node) {
	var type = (node.type||"").toLowerCase();
	return !node.disabled
		&& dojo.lang.inArray(type, ["select-multiple", "radio", "checkbox"]
		&& !dojo.lang.inArray(type, ["file", "submit", "reset", "button"];
}

dojo.io.bind({
	formNode: node,
	formFilter: filterFunc
});

Change History (2)

comment:1 Changed 14 years ago by david

Resolution: fixed
Status: newclosed

Fixed with 2857? + 2858?.

comment:2 Changed 14 years ago by david

That's [2857] and [2858], sorry.

Note: See TracTickets for help on using tickets.