Version 2 – Visibility

Home Forums Quform WordPress Version 2 – Visibility

This topic is: not resolved

This topic contains 4 replies, has 2 voices, and was last updated by  Ally 1 month, 4 weeks ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #21944

    danieltjohnston
    Participant

    I seem to be having a couple of issues with the visibility setting of an input element.

    When I set the visibility of an element to “Admin only” it still won’t display for me when logged in as an admin.

    Also, it seems like when I change the visibility to not display, the element doesn’t get created at all in the source. I’d like for the element to be created as a “hidden” type, rather than not created at all.

    Is there another option that will allow the element to be a “hidden” field instead?

    #21956

    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.

    #21957

    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.

    #21988

    danieltjohnston
    Participant

    Hi Ally,
    I was able to get the form input to take on the “hidden” type using the Admin only visibility and entering a parameter in the dynamic field, but now I have another issue because of it.

    I have my form set to load a value into that hidden field when it loads (it’s a url for a pdf download). That value is a custom meta field created by woocommerce. The code that I’m using populates that hidden field correctly. I’d then like to have the form redirect to the value in the hidden field, but the redirect won’t work. The form submits, but then just reloads the page it’s currently on. If I have the hidden field, displayed, it does re-direct correctly. Here’s the code that I’m using and the live page that I’m using it on:

    Love Is – Matching Flip Book

    function my_populate_wc_attribute($form)
    {
        $value = get_post_meta( get_the_ID(), '_dwnfile', true );
    
        $form->setValue('quform_1_4', $value);
    }
    add_action('quform_pre_display_1', 'my_populate_wc_attribute');
    
    function my_success_redirect_url($url, Quform_Confirmation $confirmation, Quform_Form $form, $post)
    {
        // Custom code example
        $url = $form->getValue('quform_1_4');
     
        return $url;
    }
    add_action('quform_confirmation_redirect_url_1_1', 'my_success_redirect_url', 10, 3);
    #22069

    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.

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.