• Resolved zukenstein

    (@zukenstein)


    I am using a button onclick event to show a field like this:

    jQuery('.cff-container-field.hide').removeClass('hide');

    Which works fine, and I want to hide it again clicking a different button to which I have assigned:

    jQuery('.cff-container-field.hide').addClass('hide');

    But this does not hide the field, it does nothing. I have tried it with both operations in the same button and it still doesn’t work, have I got something incorrect?

    Thanks

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author codepeople

    (@codepeople)

    Hello @zukenstein

    If the first click on the button removes the “hide” class name from the field, when you press the hide button, there is no field in the form that satisfies the selector: .cff-container-field.hide (the is not a container with the “hide” class). So, the “onclick” event of the second button would be:

    
    jQuery('.cff-container-field').addClass('hide');
    

    Best regards.

    Thread Starter zukenstein

    (@zukenstein)

    Excellent thank you I thought it would be something simple!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide unhide field’ is closed to new replies.