Home › Forums › Quform WordPress › Entry view – conditionally hide hidden fields
- This topic has 6 replies, 2 voices, and was last updated 6 years, 9 months ago by
katw.
- AuthorPosts
- May 4, 2018 at 6:13 am #25494
katw
ParticipantHi,
Hidden fields don’t have access to the conditional hide/show logic .
As a consequence, hidden fields always show in Entry View mode when the fields they relate to may be hidden as they didn’t apply or were not needed.
I want to be able to hide/show these fields in Entry view.
To explain:
————Contact by: (_) Phone (_) Email
On clicking Phone, the field Phone Number: [________] shows;
on clicking Email the field Email address:[____________] shows.Imagine there are two hidden, but related fields:
PhoneInternationalFormat
isFreeEmailAddressProgramatically, these hidden fields may have values, depending on the contact_by choice.
If they chose phone I would expect to see the value of fields: Phone Number and PhoneInternationalFormat showing in Entry View. But NOT Email address or isFreeEmailAddress.
As conditional logic is applied to the Email Address and Phone Number fields they wont show if the checkboxes in “Contact_by” haven’t been selected. But the hidden fields show all the time in entry view as I can’t make it conditionally viewable.
For entry view I would like to test for values set in “Contact by” (which was a checkbox group) and hide not applicable hidden fields.
I am guessing I would use the hook ‘quform_entry_pre_process_1’ and access the values of the form per Getting form values but how do I programatically show and hide the entry form label and entry form value for these hidden fields?
Thanks again
May 4, 2018 at 4:33 pm #25496Ally
Support StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
May 5, 2018 at 2:12 am #25498katw
ParticipantThat’s great re:update.
When you say JS do you mean toggling CSS display.none; or actually JQuery hide();?
May 8, 2018 at 5:54 pm #25579Ally
Support StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
August 3, 2018 at 5:09 am #26512katw
ParticipantHi Ally,
An old discussion but my problem isn’t solved by your suggestion.
Hidden fields can’t be conditionally hidden or shown like other fields can.
A field that is conditionally visible has an extra benefit; they remain hidden in Entry View even if the “show empty fields’ checkbox is enabled.
Hidden fields become visible when empty AND “Show empty fields” is active; even if these fields do not apply.
Use case:
- Contact by: radio field with choices: Phone, Email
- On choosing “Phone” a Phone number field is shown; otherwise phone field not shown.
- Imagine a hidden field called “Phone INT format”; which contains a calculated value based on the phone field.
- This field IS CONTEXTUAL and is only relevant if “Phone” is “Contact_by” choice.
- On viewing an entry with “Phone” being the Contact method you see Phone Number field and Phone INT format field – GOOD
- On viewing entry without “Phone” as Contact method and “View empty fields=true” you don’t see Phone Number field but still see Phone INT format field – BAD
The Phone number field doesn’t show and it was empty… but its companion hidden field is visible.
Would be great to have conditional show and hide available to hidden fields; or a way to remove these fields from Entry View when they don’t apply.
August 6, 2018 at 3:26 pm #26549Ally
Support StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
August 7, 2018 at 1:19 am #26563katw
ParticipantThought I had done that. But upon inspection it was in a row/column construct.
Thanks for that suggestion. Will try it out.
- AuthorPosts
- You must be logged in to reply to this topic.