Home › Forums › Quform WordPress › Expanding form scripts
- This topic has 8 replies, 2 voices, and was last updated 10 years, 10 months ago by Ally.
- AuthorPosts
- March 9, 2014 at 2:34 am #9012kemigaParticipant
I managed to make my form with various groups that drops down when pressing “NEXT”
I used this tutorial:
Demo:
https://www.quform.com/examples/expanding-formWhen pressing the first “NEXT” button, the group 2 appears while it slides down. That part is okay.
But I want that while I press that “NEXT” button, the first group should display: none;
I want that it feels like multi pages, and not just dropdowns that slides down when pressing the “NEXT” button.
Someone have an idea for that?
March 9, 2014 at 6:00 am #9016kemigaParticipantI actually found out how to hide the group. Might help others:
<script type="text/javascript">
jQuery(document).ready(function ($) {
$('#show-section-2').click(function () {
$(this).remove();
$('.iphorm_1_10-group-wrap').slideDown();
$('.iphorm_1_5-group-wrap').hide();
$('.iphorm-submit-wrap-2').show();
return false;
});
});
</script>
Just insert the .hide line below into the already existing code above
$('.iphorm_1_5-group-wrap').hide();
Cheers
March 9, 2014 at 8:09 am #9018kemigaParticipantOk, so I got to hide the groups.. but I still need to show all the groups again if there is an error.
For example, if some of the required fields is not filled.
.iphorm-errors-wrap
How to show the groups again if the form is not sent because of the missing required fields?
March 10, 2014 at 10:57 am #9041AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
March 10, 2014 at 3:53 pm #9062kemigaParticipantHi Ally,
Thanks for the reply.
Well for me the easy workaround could be just to show the groups again if the error message appears.
How can I show the groups again if it there is an error?
March 10, 2014 at 5:02 pm #9065AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
March 10, 2014 at 5:59 pm #9068kemigaParticipantI found the code:
$('.iphorm-errors-wrap', $form).fadeIn(1000).show();
Could you be more specific what to do and what to add?
I guess you want to say add the following after the code above?
$('.iphorm_1_5-group-wrap').show();
- This reply was modified 10 years, 10 months ago by kemiga.
March 10, 2014 at 7:10 pm #9071kemigaParticipantOk tried this and it worked. I know it’s a temporary workaround, but it worked:
// Fade all errors in
$('.iphorm-errors-wrap', $form).fadeIn(1000).show();$('.iphorm_1_5-group-wrap').show(); <-- added this unique line
$('.iphorm_1_10-group-wrap').show(); <-- added this unique line
And when submitting the form again & if having success, I added the following part:
// Custom success callback
if (typeof settings.success === 'function') {
settings.success();
}
});$('.iphorm_1_5-group-wrap').hide(); <-- added this unique line
$('.iphorm_1_10-group-wrap').hide(); <-- added this unique line
$('.iphorm-submit-input-wrap-4').hide(); <-- added this unique line
Thanks for the hints. Will look forward to the new plugin updates.
- This reply was modified 10 years, 10 months ago by kemiga.
March 11, 2014 at 2:41 pm #9080AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.