Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Updated Form Data without clicking on Submit button #26

Closed
ahmedsakri opened this issue Feb 5, 2024 · 9 comments
Closed

Get Updated Form Data without clicking on Submit button #26

ahmedsakri opened this issue Feb 5, 2024 · 9 comments
Assignees
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@ahmedsakri
Copy link

Is your feature request related to a problem? Please describe.
I am trying to access the updated form object without clicking on submit. Ideally i should be able to get this.

Describe the solution you'd like
An Event Emitted like onFormUpdate or onUpdate similar to onChange() event which emits just one input data.

Describe alternatives you've considered
N/A

Additional context
Add any other context or screenshots about the feature request here.

@ahmedsakri
Copy link
Author

@manojadams any thoughts on above?

@manojadams
Copy link
Owner

Thanks for the suggestion @ahmedsakri.

Looks like a good idea.

@manojadams manojadams self-assigned this Feb 5, 2024
@manojadams manojadams added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 5, 2024
@manojadams
Copy link
Owner

Hi @ahmedsakri, The onChange event would send data in the following form:

  • section - the info about the form grouping to which the field belongs
  • field - the name of the field
  • value - the changed value of the field

Does it not solve your problem?

@ahmedsakri
Copy link
Author

@manojadams No, this does not solve it because this returns the data related to only one input field. Whereas, i want the updated whole form data. This can be in another event passed like: onFormUpdate or onUpdate as onChange event returns data related to a single input field.

@manojadams
Copy link
Owner

manojadams commented Feb 5, 2024

@ahmedsakri Following version contains the enhancement:
mui-forms@1.0.33

Refer to the following section: https://mui-forms.vercel.app/installation

  • changeResponseMode should be provided with value 'form-data' to get form data as a second parameter.
<MuiForms
    className="s-form"
    schema={schema}
    changeResponseMode="form-data"
    onChange={(fieldData, formData) => {
        console.log(fieldData); // This is the field data with the current change
        console.log(formData); // This is the form data of all the fields
    }}
    onSubmit={() => {
        // to do
    }}
/>

Feel free to open this, if it still does not work for you.

@ahmedsakri
Copy link
Author

@manojadams The newly added prop is onChangeMode and not changeResponseMode. Just checked the Merge Request in metaforms/core repository. Thanks!

@manojadams
Copy link
Owner

@ahmedsakri It has been initially added as onChangeMode but renamed into changeResponseMode. Here:
https://github.com/manojadams/metaforms-core/blob/master/src/MetaformRenderer.tsx

@manojadams
Copy link
Owner

@ahmedsakri Also, if you find the lib useful, can you give it a start.
Will be helpful to make it more popular :).

@ahmedsakri
Copy link
Author

@manojadams Thanks and i have added a star to the repository!.

manojadams added a commit that referenced this issue Feb 6, 2024
* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg
manojadams added a commit that referenced this issue Feb 11, 2024
* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #32: adding default space config
manojadams added a commit that referenced this issue Feb 11, 2024
* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* Fix 32 (#33)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #32: adding default space config
manojadams added a commit that referenced this issue Mar 18, 2024
* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #49: add feature to add icons using name
manojadams added a commit that referenced this issue Mar 18, 2024
* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* Fix 32 (#33)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #32: adding default space config

* Feature/icons (#50)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #49: add feature to add icons using name
manojadams added a commit that referenced this issue Apr 2, 2024
* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* Fix 32 (#33)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #32: adding default space config

* Feature/icons (#50)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #49: add feature to add icons using name

* fix #56: enhance file control

* linting
manojadams added a commit that referenced this issue Apr 2, 2024
* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* Fix 32 (#33)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #32: adding default space config

* Feature/icons (#50)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #49: add feature to add icons using name

* fix #56: enhance file control

* linting

* fix #53: adding input mask control

* cleanup pkg

* cleanup pkg

* linting
manojadams added a commit that referenced this issue Apr 5, 2024
* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* Fix 32 (#33)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #32: adding default space config

* Feature/icons (#50)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #49: add feature to add icons using name

* fix #56: enhance file control

* linting

* fix #53: adding input mask control

* cleanup pkg

* cleanup pkg

* linting

* fix #59: file preview bug fix

* linting

* fix #59: file preview

* linting
manojadams added a commit that referenced this issue Apr 12, 2024
* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* Fix 32 (#33)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #32: adding default space config

* Feature/icons (#50)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #49: add feature to add icons using name

* fix #56: enhance file control

* linting

* fix #53: adding input mask control

* cleanup pkg

* cleanup pkg

* linting

* fix #59: file preview bug fix

* linting

* fix #59: file preview

* linting

* fix #61: add support for multiselect

* linting
manojadams added a commit that referenced this issue Apr 22, 2024
* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* Fix 32 (#33)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #32: adding default space config

* Feature/icons (#50)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #49: add feature to add icons using name

* fix #56: enhance file control

* linting

* fix #53: adding input mask control

* cleanup pkg

* cleanup pkg

* linting

* fix #59: file preview bug fix

* linting

* fix #59: file preview

* linting

* fix #61: add support for multiselect

* linting

* fix #67: fix disabled prop for radio

---------

Co-authored-by: Manoj Baruah <mbaruah@pingidentity.com>
manojadams added a commit that referenced this issue Apr 22, 2024
* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* Fix 32 (#33)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #32: adding default space config

* Feature/icons (#50)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #49: add feature to add icons using name

* fix #56: enhance file control

* linting

* fix #53: adding input mask control

* cleanup pkg

* cleanup pkg

* linting

* fix #59: file preview bug fix

* linting

* fix #59: file preview

* linting

* fix #61: add support for multiselect

* linting

* fix #67: fix disabled prop for radio

* fix #69: fix size for search field

* MR latest

---------

Co-authored-by: Manoj Baruah <mbaruah@pingidentity.com>
manojadams added a commit that referenced this issue May 8, 2024
* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* Fix 32 (#33)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #32: adding default space config

* Feature/icons (#50)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #49: add feature to add icons using name

* fix #56: enhance file control

* linting

* fix #53: adding input mask control

* cleanup pkg

* cleanup pkg

* linting

* fix #59: file preview bug fix

* linting

* fix #59: file preview

* linting

* fix #61: add support for multiselect

* linting

* fix #67: fix disabled prop for radio

* fix #69: fix size for search field

* MR latest

* fix #74: fix checkbox control not working with boolean values

---------

Co-authored-by: Manoj Baruah <mbaruah@pingidentity.com>
manojadams added a commit that referenced this issue May 15, 2024
* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* Fix 32 (#33)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #32: adding default space config

* Feature/icons (#50)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #49: add feature to add icons using name

* fix #56: enhance file control

* linting

* fix #53: adding input mask control

* cleanup pkg

* cleanup pkg

* linting

* fix #59: file preview bug fix

* linting

* fix #59: file preview

* linting

* fix #61: add support for multiselect

* linting

* fix #67: fix disabled prop for radio

* fix #69: fix size for search field

* MR latest

* fix #74: fix checkbox control not working with boolean values

* fix #78: handle disabled tab navigation through config params

---------

Co-authored-by: Manoj Baruah <mbaruah@pingidentity.com>
manojadams added a commit that referenced this issue May 16, 2024
* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* Fix 32 (#33)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #32: adding default space config

* Feature/icons (#50)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #49: add feature to add icons using name

* fix #56: enhance file control

* linting

* fix #53: adding input mask control

* cleanup pkg

* cleanup pkg

* linting

* fix #59: file preview bug fix

* linting

* fix #59: file preview

* linting

* fix #61: add support for multiselect

* linting

* fix #67: fix disabled prop for radio

* fix #69: fix size for search field

* MR latest

* fix #74: fix checkbox control not working with boolean values

* fix #78: handle disabled tab navigation through config params

* fix #85: display name not working for phone

---------

Co-authored-by: Manoj Baruah <mbaruah@pingidentity.com>
manojadams added a commit that referenced this issue Jun 1, 2024
* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* Fix 32 (#33)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #32: adding default space config

* Feature/icons (#50)

* Develop (#30)

* fix #26: Get Updated Form Data without clicking on Submit button

* update pkg version

* update pgk

* fix #29: dynamic data loading for select control

* update pkg

* update pkg

* fix #49: add feature to add icons using name

* fix #56: enhance file control

* linting

* fix #53: adding input mask control

* cleanup pkg

* cleanup pkg

* linting

* fix #59: file preview bug fix

* linting

* fix #59: file preview

* linting

* fix #61: add support for multiselect

* linting

* fix #67: fix disabled prop for radio

* fix #69: fix size for search field

* MR latest

* fix #74: fix checkbox control not working with boolean values

* fix #78: handle disabled tab navigation through config params

* fix #85: display name not working for phone

* fix #87: fix for controls not using custom classname

---------

Co-authored-by: Manoj Baruah <mbaruah@pingidentity.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants