Home › Forums › Quform PHP › Conditional logic in Quform PHP?
- This topic has 9 replies, 3 voices, and was last updated 9 years, 6 months ago by Kelvin Lee.
- AuthorPosts
- April 21, 2015 at 8:23 pm #15106jeff.waiteParticipant
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?
April 21, 2015 at 9:20 pm #15109AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
May 11, 2015 at 3:27 pm #15257Kelvin LeeParticipantDear 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
May 11, 2015 at 4:46 pm #15267Kelvin LeeParticipantDear 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.
May 11, 2015 at 7:58 pm #15271AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
May 12, 2015 at 12:16 am #15274Kelvin LeeParticipantDear Ally,
Many thanks for your code, your code works perfectly.
Best regards,
Kelvin.
May 12, 2015 at 3:01 am #15278Kelvin LeeParticipantDear 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.
May 12, 2015 at 1:29 pm #15284AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
May 12, 2015 at 6:28 pm #15288Kelvin LeeParticipantDear 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
May 12, 2015 at 6:50 pm #15290Kelvin LeeParticipantDear Ally,
I fixed the problem by adding checkboxradio(“refresh”)
$(this).attr(‘checked’, false).checkboxradio(“refresh”);
Best regards,
Kelvin
- AuthorPosts
- You must be logged in to reply to this topic.