Conditional logic in Quform PHP?

Home Forums Quform PHP Conditional logic in Quform PHP?

This topic is: not resolved
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #15106
    jeff.waite
    Participant

    I am a user of your wordpress quform plugin and love it.
    Now I am building a standalone site using PHP but no wordpress so I purchased your Quform PHP script.

    I am curious if there is a way to gain the conditional logic functionality in the PHP version of Quform.
    I can’t believe no one else has asked this but in searching the forum it found no results for the word ‘conditional’.

    Are there any guides available for getting the conditional logic features that are present in the wordpress version of the script?

    #15109
    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.

    #15257
    Kelvin Lee
    Participant

    Dear Ally,

    How can I add the id for radio element? I tried to add id=”feedback” to each <input …> but not work

    <div class="quform-element quform-element-radio">
    <div class="quform-spacer">
    <label class="field" for="feedback"></label>
    <div class="quform-input no-width">
    <div class="quform-options quform-options-inline">
    <div class="quform-option">
    <label class="round"><input name="feedback" value="1" type="radio" />Agree</label>
    </div>
    <div class="quform-option">
    <label class="round"><input name="feedback" value="2" type="radio" />Agree with condition</label>
    </div>
    <div class="quform-option">
    <label class="round"><input name="feedback" value="3" type="radio" />No comment</label>
    </div>
    <div class="quform-option">
    <label class="round"><input name="feedback" value="4" type="radio" />Disagree</label>
    </div>
    <div class="quform-option">
    <label class="round"><input name="feedback" value="5" type="radio" />Strong disagree</label>
    </div>
    </div>
    </div>
    </div>
    </div>

    I want to hide below code if the 2nd radio button of above code is selected.


    <div class="quform-element quform-element-checkbox">
    <div class="quform-spacer">
    <label class="field" for="reason"></label>
    <div class="quform-input no-width">
    <div class="quform-options quform-options-inline">
    <div class="quform-option">
    <label><input name="reason[]" value="1" type="checkbox" />Reason 1</label>
    </div>
    <div class="quform-option">
    <label><input name="reason[]" value="2" type="checkbox" />Reason 2</label>
    </div>
    <div class="quform-option">
    <label><input name="reason[]" value="3" type="checkbox" />Reason 3</label>
    </div>
    <div class="quform-option">
    <label><input name="reason[]" value="4" type="checkbox" />Reason 4</label>
    </div>
    <div class="quform-option">
    <label><input name="reason[]" value="5" type="checkbox" />Reason 5</label>
    </div>
    </div>
    </div>
    </div>
    </div>

    • This reply was modified 9 years, 6 months ago by Kelvin Lee. Reason: Reformat
    #15267
    Kelvin Lee
    Participant

    Dear Ally,

    I need to embed the quform with JQM, I also read http://jsfiddle.net/ezanker/bgyY2/1/ and try but not work. Your above code work only on without JQM. How can I trigger the radio button and then show/hide another element under JQM?

    Best regards,

    Kelvin.

    #15271
    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.

    #15274
    Kelvin Lee
    Participant

    Dear Ally,

    Many thanks for your code, your code works perfectly.

    Best regards,

    Kelvin.

    #15278
    Kelvin Lee
    Participant

    Dear Ally,

    Follow to this topic, how can I configure the input element as require field if form meets the specific condition? Configuring the field as required is PHP but conditionally show the field is Javascript, how can I check the condition using javascript by changing the PHP code to set whether the field is required or not?

    Best regards,

    Kelvin.

    #15284
    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.

    #15288
    Kelvin Lee
    Participant

    Dear Ally,

    Thanks millions.

    How can I uncheck all checked checkboxes if radio button 2 is not selected? I tried below code but failed


    if (value == 2) {
    $checkboxWrap.slideDown();
    } else {
    $('input[name="reason[]"]').each(function () {
    $(this).attr('checked', false);
    });
    $checkboxWrap.slideUp();
    }

    • This reply was modified 9 years, 6 months ago by Kelvin Lee. Reason: Reformat
    #15290
    Kelvin Lee
    Participant

    Dear Ally,

    I fixed the problem by adding checkboxradio(“refresh”)

    $(this).attr(‘checked’, false).checkboxradio(“refresh”);

    Best regards,

    Kelvin

Viewing 10 posts - 1 through 10 (of 10 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