-
-
Notifications
You must be signed in to change notification settings - Fork 265
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
Add checkValidation and isValid methods to window.PodsDFV #6898
Labels
Type: Enhancement
Enhancements to features that already exist, but are not major additions
Milestone
Comments
sc0ttkclark
added
the
Type: Enhancement
Enhancements to features that already exist, but are not major additions
label
Sep 11, 2022
sc0ttkclark
modified the milestones:
Pods 2.9.5,
Pods 2.9.6,
Pods 2.9.8,
Pods 2.9.9,
Pods 2.9.10
Sep 22, 2022
Not sure if it would be helpful here to also have a similar API to check if a field is conditionally visible (based on conditional logic). |
Shelob9
added a commit
that referenced
this issue
Apr 20, 2023
8 tasks
Shelob9
added a commit
that referenced
this issue
Apr 21, 2023
Shelob9
added a commit
that referenced
this issue
Apr 21, 2023
Shelob9
added a commit
that referenced
this issue
Apr 21, 2023
Shelob9
added a commit
that referenced
this issue
Apr 25, 2023
Shelob9
added a commit
that referenced
this issue
Apr 25, 2023
Shelob9
added a commit
that referenced
this issue
Apr 25, 2023
#6898 Co-authored-by: Scott Kingsley Clark <[email protected]>
sc0ttkclark
pushed a commit
that referenced
this issue
Apr 25, 2023
sc0ttkclark
pushed a commit
that referenced
this issue
Apr 25, 2023
sc0ttkclark
pushed a commit
that referenced
this issue
Apr 25, 2023
sc0ttkclark
pushed a commit
that referenced
this issue
Apr 25, 2023
sc0ttkclark
pushed a commit
that referenced
this issue
Apr 25, 2023
sc0ttkclark
pushed a commit
that referenced
this issue
Apr 25, 2023
sc0ttkclark
added a commit
that referenced
this issue
Apr 25, 2023
#6898 Co-authored-by: Scott Kingsley Clark <[email protected]>
Shelob9
added a commit
that referenced
this issue
Apr 25, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Problem to Solve
In places where we want to have integration with other forms and stop them from submitting if there are invalid/required fields -- we want to be able to get at this information from inside and outside of DFV.
Proposed Solution
Add checkValidation and isValid methods to window.PodsDFV so that they can be called:
validationMessages = window.PodsDFV.checkValidation( pod, itemId, formCounter )
before submit to run validation rules on current values (even if they have not changed and triggered a validation yet) and passes back the list of validationMessages that can be displayed in a modal/alert or in Block Editor publish message section or something later when we are ready for thatwindow.PodsDFV.isValid( pod, itemId, formCounter )
after runningcheckValidation()
to determine whether the form should be allowed to continue being submittedPossible Workaround
Manually going through the field values from what we get from
window.PodsDFV.getFieldValuesWithConfigs()
and checking whether required is on for the field and then confirming whether the field is empty.It's not a great solution but that's what the
jquery.pods.js
uses right now as a workaround for thesubmit()
handling.Examples Elsewhere
No response
Screenshots / Screencast
No response
The text was updated successfully, but these errors were encountered: