Skip to content

Add setting in ufForm to specify which fields are sent with form submission #834

@alexweissman

Description

@alexweissman

This could be useful for example with fields like credit-card numbers, which need to be submitted to a third-party service (like Stripe), but should not be submitted to your own server for security and compliance purposes.

Right now ufForm submits any form fields of class :input in both the _urlencodeData and _multipartData methods. Instead, we could allow a jQuery selector string, or even a callback, to be passed as a setting to ufForm with :input as the default. This would allow you to prevent certain fields from being submitted with .not or :not.

This would also be a good opportunity to refactor _urlencodeData and _multipartData to make them a little DRYer.

For the time being, a workaround is simply to disable fields like these in the beforeSubmitCallback, but that changes the UI and is not necessarily the most desirable solution.

It's also worth noting that jqueryvalidation has an ignore setting, but this only affects whether fields are validated, as opposed to whether they are submitted. You might want to validate a credit card number client-side, but not actually submit it with the form to your server.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    References

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions