Hidden fields for forms
Closed this issue ยท 5 comments
Initiative
Improve forms of the onOffice for WP-Websites Plugin for a better user experience.
Epic
Implement hidden fields for forms.
User story
As a real estate agent utilizing the onOffice for WP-Websites Plugin, I encounter scenarios where certain form fields need to be hidden from customers in the frontend. This is crucial for initiating internal processes upon receiving form submissions. Presently, the plugin lacks the functionality to designate form fields as hidden. Therefore, I propose the implementation of a feature that allows me to easily mark designated form fields as hidden using a checkbox. These hidden fields should remain invisible to customers in the frontend while being transmitted both in the email notification and the attached XML file upon form submission.
The ability to set form fields as hidden is essential for streamlining internal processes triggered by form submissions. This feature is especially valuable for real estate agents who need to capture specific data for internal workflows while maintaining a seamless and uncluttered user experience on the frontend.
- Implement a checkbox option in the forms to allow users to designate specific form fields as hidden. Note: GDPR status and TOS should never be marked as hidden for legal reasons.
- Ensure that, upon form submission, hidden fields are included in the email sent to the designated recipient.
- While the fields values that are marked with the hidden attribute are not displayed to the user in the page's content, it is visible and can be edited using any browser's developer tools or "View Source" functionality. Therefore we also need to add the "disabled" attribute to all fields that are marked as hidden.
By successfully implementing this hidden form field functionality, the onOffice for WP-Websites Plugin can significantly enhance the flexibility and utility of forms for real estate agents.
Further links
- https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/hidden
- https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/hidden
- https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled
Hidden field disabled in Backend:
Hidden field disabled in backend - Frontend display:
- Note: GDPR status and TOS should never be marked as hidden for legal reasons.
Please, confirm for me the fields that you mentioned:
- GDPR status <=> GDPR Status (key: DSGVOStatus) or GDPR (Checkbox) (key:gdprcheckbox)
- TOS <=> Terms and Conditions Accepted (key: AGB_akzeptiert)
These hidden fields should remain invisible to customers in the frontend while being transmitted both in the email notification and the attached XML file upon form submission.
=> We only implement send "default value" to formData. Do you agree with my solution?
- On the other hand: Will we not implement adding "hidden field" checkbox in the "Applicant Search Form", right?
Note: Old users need to update the template.dist folder to use this feature.
I have implemented it in the branch (https://github.com/onOffice-Web-Org/oo-wp-plugin/tree/44694-hidden-fields-for-forms), please review it and let me know your opinions. Thanks!
GDPR status <=> GDPR Status (key: DSGVOStatus) or GDPR (Checkbox) (key:gdprcheckbox)
TOS <=> Terms and Conditions Accepted (key: AGB_akzeptiert)
For GDPR status both should never be able to be made hidden.
Yes I can confirm that the TOS is AGB_akzeptiert.
We only implement send "default value" to formData. Do you agree with my solution?
This sounds good to me. Please implement the suggested solution
On the other hand: Will we not implement adding "hidden field" checkbox in the "Applicant Search Form", right?
yes, it would not make sense to implement this feature for applicant search form.
@fredericalpers I got it, thanks!
@fredericalpers Let me test it again before you change it to in-review, thanks !
@fredericalpers I have finished the testing. Please help us review it, thanks!