Entry view – conditionally hide hidden fields

Home Forums Quform WordPress Entry view – conditionally hide hidden fields

This topic is: resolved
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #25494
    katw
    Participant

    Hi,

    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
    isFreeEmailAddress

    Programatically, 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

    #25496
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #25498
    katw
    Participant

    That’s great re:update.

    When you say JS do you mean toggling CSS display.none; or actually JQuery hide();?

    #25579
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #26512
    katw
    Participant

    Hi 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.

    #26549
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

    #26563
    katw
    Participant

    Thought I had done that. But upon inspection it was in a row/column construct.

    Thanks for that suggestion. Will try it out.

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy