Syphon serializes disabled fields

170 views Asked by At

Looks like Syphon is currently serializing every form field regardless of its state. Is there a way to easily tell Syphon to not serialize disabled fields?

1

There are 1 answers

0
dbrin On BEST ANSWER

Standard form submit does not include disabled fields and neither does JQuery serialize() method.

Since my primary concern was with disabled checkboxes getting serialized I was able to stop it from serializing those by adding this validator:

Backbone.Syphon.KeyAssignmentValidators.register("checkbox", function ($el, key, value) {
    return $el.prop("checked") && $el.is(":enabled");
});

Note: this is a global change and effects all views.