jaxon-php / jaxon-js

The Jaxon javascript library https://www.jaxon-php.org.
BSD 3-Clause "New" or "Revised" License
4 stars 2 forks source link

Documentation update for jaxon.getFormValues #31

Closed walmartshopper closed 2 weeks ago

walmartshopper commented 3 weeks ago

The documentation for jaxon.getFormValues does not mention the second and third parameters. The second parameter is a bool, and if set to true includes disabled form fields. The third parameter is string prefix, and only form fields matching the prefix will be included. These parameters were carried over from xajax.

I would also like to point out that in xajax and jaxon up through version 3, the syntax jaxon.getFormValues('id', 1) worked for submitting disabled form fields.

In version 4, the above syntax does not submit disabled form fields. It only submits disabled fields using the syntax jaxon.getFormValues('id', true)

This is not a bug report, just a request to possibly mention this in the "Migration from version 3" documentation. If the older syntax is being used and you update jaxon from v3 to v4 without knowing about this change, it could result in data loss when disabled form fields that were previously submitted are no longer being submitted.

feuzeu commented 2 weeks ago

Hi,

I made a change related to this issue in the 4.0.6 release. You can now call jaxon.getFormValues('id', 1) as well as jaxon.getFormValues('id', true).