Home › Forums › Quform WordPress › show / hide group of fields from js
- This topic has 2 replies, 2 voices, and was last updated 2 years, 1 month ago by oivanr.
- AuthorPosts
- September 30, 2022 at 11:57 pm #34780oivanrParticipant
Hi,
I am trying to show/hide dinamically a fieldset (group). I am using the follow script1 $(‘.quform-field-6_28’).change(function () {
2 valorOpcion = $(‘.quform-field-6_28’).val();
3 if (valorOpcion === ‘0’){
4 $(‘.quform-field-6_18’).filter(‘[value=M]’).prop(‘checked’,true);
5 $(‘.quform-field-6_37’).show();
6 $(‘.quform-element-6_37 .quform-element-row’).each(function (index, row) {
7 var contador = 9;
8 console.log(contador);
9 var $row = $(row);
10 if (index < 9) {
11 $row.show();
12 }
13 })
14 }
15 })Line 2, take the val of a field a put into a variable
Line 3, compare the value and if it is string 0, check a button radio group
Line 4, check the option in the button radio
Line 5, doesn’t work
Tehe rest is fine.
Everything is fine except for the line 5. it doesn’t show the group of fields.
Thanks in advance for your help.October 3, 2022 at 10:13 am #34784AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
October 3, 2022 at 10:23 pm #34791oivanrParticipantHi,
It works great!!
Indeed you have a great plugin, I had been for several years now and is absolutely fantastic.
Check this issue as resolved, please.
Thanks a lot - AuthorPosts
- You must be logged in to reply to this topic.