Contact form issue after cloning

After cloning a contact form the labels in fields stopped going up on a click

  • Nithin
    • Support Wizard

    Hi Benji,

    I gave a closer look, and tried couple of jQuery codes to add the missing class, so that the label goes up on click.

    However, the codes doesn't seem to help in this case, as I don't see a way to target the action unique to each label. I'm bringing this into our Second Level Support(SLS) teams attention, and see whether there is any quick workaround that could be applied regarding this. Please do note that, if our SLS team finds it a bit complex, then it would fall under custom coding.

    Could you please share your sites WP admin login, and FTP login so that I could escalate this to SLS.

    You can send credentials by using our secure contact form: https://premium.wpmudev.org/contact/#i-have-a-different-question

    - To Mark to my attention, the subject line should contain only: ATTN: Nithin Ramdas
    -WordPress admin username
    -WordPress admin password
    -login url
    -FTP credentials (host/username/password)
    -link back to this thread for reference
    -any other relevant urls

    Please do follow up in the ticket once you have sent the above credentials. Have a nice day. :slight_smile:

    Regards,
    Nithin

  • Nithin
    • Support Wizard

    Hi Benji,

    Thanks for sharing the login credentials. I have escalated this to our SLS team, so that this could be looked upon closely.

    Please do note that SLS works on complex issues, and have a slow response time. We'll get back to you via the ticket, once we have checked whether there is any easy workaround.

    Have a great day ahead. :slight_smile:

    Regards,
    Nithin

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Hi Benji ,

    I've added a small code snippet into your child themes .js file.

    You'll see almost at the top this code added:

    $( document ).on ( 'focusin', '.wn-cnform', function(e) {
                if ( ! $( this ).hasClass( 'wn-active' ) ) {
                    $( this ).addClass( 'wn-active' );
                }
            });
    
            $( document ).on ( 'focusout', '.wn-cnform', function(e) {
                if ( $( this ).hasClass( 'wn-active' ) ) {
                    $( this ).removeClass( 'wn-active' );
                }
            });

    This will trigger the focusin/out events when going through the form to add the appropriate classes.

    I hope this helps and tell me if you need any more assistance with this!

    Regards,
    Konstantinos

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Hey Benji ,

    I've updated the script and added :

    $( document ).on( 'click', '.clear-checkboxes', function(e) {
                e.preventDefault;
               $( this ).parent().parent().find( 'input[type=checkbox]').each( function(){
                   $( this ).prop( 'checked', false );
               });
               return false;
            });

    This should do the trick for the checkboxes and also disable the automatic scrolling to the top of the page for the clear buttons.

    Regards,
    Konstantinos

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Oh you mean about the 'original' first form button. I'm sorry I only looked at the duplicated ones.

    I also see another issue with the checkboxes, on your 'duplicated' forms you can select multiple checkboxes of the same group, I guess that's something that you don't want as well so I'll take a look if I can help there as well.

    I'll get back to you as soon as possible.

    Regards,
    Konstantinos

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Benji ,

    I've commented out this piece of code from the .js

    // $('.clear-checkboxes').on('click', function (e) {
                //     e.preventDefault();
                //     $('.wrap-checkboxes').find('.wpcf7-list-item').find('input[type="checkbox"]').prop('checked', false);
                // });

    So the Clear buttons should be working now, as it was overlapping my own code that I've added.

    Unfortunately the checkboxes to be checked 1 at a time require the Classes to be added on their parent elements ( mini, junior, senior ) but I don't see any global way to easily add them on the new forms as they don't have any other unique identifiers.

    I'm not sure how the form is built, but those checkboxes should be on single lists by design and they are not. Maybe you could change that in the forms itself.

    Regards,
    Konstantinos

  • Konstantinos Xenos
    • Rubber Duck Debugger

    You can explain to them the situation that the "copied" forms are lacking the mini, junior, senior classes so the "single checkbox" selection is not working. That results on the new forms being able to select all checkboxes actually.

    The way that it will be handled it's up to them entirely. Since the form was custom built for you it would be for the best either way to contact the original developer since he knows better the history and scope of it.

    Regards,
    Konstantinos

  • Konstantinos Xenos
    • Rubber Duck Debugger

    Hey Benji ,

    Since you already have a dedicated developer that created the form and knows his code 100% as I've mentioned on my last reply, I strongly feel that you should continue the changes with the Developer as well so we don't mess around with the code much and change something un-wanted.

    If you need further help with custom development you can as well hire help from our partners page:
    https://premium.wpmudev.org/partners/#wpmud-hg-discounts-services

    Regards,
    Konstantinos

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.