I have a problem with the Conditional Fields plugin (or believe it to be) that when there is an issue with a required field, and when the page reloads with the field values that were there prior to the save.
The user has to then select another value in the dropdown field I am using, and reselect their original value for the relevant fields to display again. On the initial page load, the user selects the relevant item from the drop down list, and all works without issue, it’s only if there is an issue with a required field that it does not load the page properly.
I have set my fields to be available to the relevant member types, and those without a member type value (ie before the value is saved the first time around)
I have had to run a check on the field values in your plugin, as it does not handle the member type Xprofile field type very well. It would not save any of the values when this was not included.
What is going wrong the plugin, or my code?
Thank you for posting.
1. Currently the plugin only supports core BuddyPress field. We do plan to add support for custom field type in future.
2. It will not work if you have a field marked as required and which is controlled by conditions. The best way is to not mark conditional fields as required. We understand that you still want to validate that field. Please see the below topic for an example of validation
yours can be simpler than that.
If you need assistance with code, please do post me the field ids and the details for validation and I will help.
Thanks for the example, I understand the code, but this is once the account is already created. They are editing their profile, rather than signing up, so the sign up validation hook isn’t going to work.
The field in question that gets hidden depending on the value is 56, and the field that it depends on for this is 6.
Is there a way to fire off the trigger that shows the fields, when the profile form is reloaded after an error, and loads the values that were entered before the error?
This is what is not doing on a page reload when a required profile field has an error.
- This reply was modified 5 years, 3 months ago by Brett. Reason: Incorrectly marked as resolved and provided incorrect information
I hope so!
The issue only rears it’s head when there is an error with required fields, and when BuddyPress reloads the form with the submitted values that existed before the error, your plugin doesn’t appear to be triggered to show the conditional fields.
If needed, I can provide those.
All the fields are dependent on that value displayed in field 6. It appears to be that since the page is reloading with a value that is not yet saved in the xprofile field, that it does not treat it properly.
You must be logged in to reply to this topic.