• Resolved zealzy

    (@zealzy)


    Hi!

    Is it possible to make a onclick function when i click on a button to just show a field.
    So the field is hidden at first, when i click on the button in shows up.

    What code can i use?

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

    (@codepeople)

    Hello @zealzy

    Yes, of course.

    First, assign the class name hide-strong to the fields you want to hide by default. The class names are assigned to the fields through their attributes: “Add CSS Layout Keywords”.

    Second, enter the following piece of code as the onclick event of the button:

    
    jQuery('.hide-strong').removeClass('hide-strong');
    

    Best regards.

    Thread Starter zealzy

    (@zealzy)

    Thank you for your fast respond, but now i have the problem, when I click on the button u named me, other fields pop on also. Fields i don’t want to pop up.

    Is het also possible when I click on a button a field appear and a other disappears?

    Thank you already answering this 2 questions!

    Plugin Author codepeople

    (@codepeople)

    Hello @zealzy

    In this case, you can assign two class names to the fields you want to show, for example: fields-a hide-strong

    And the code of the button would be:

    
    jQuery('.fields-a').removeClass('hide-strong');
    

    The previous code would affect only the fields with the class name: fields-a

    If you have other fields with the class name: fields-b and you want to hide them by pressing the same button, the onclick event would be:

    
    jQuery('.fields-a').removeClass('hide-strong');jQuery('.fields-b').addClass('hide-strong');
    

    Best regards.

    Thread Starter zealzy

    (@zealzy)

    Thank you for your fast responding!
    Excellent service! Thank you very much 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘On-click button show field’ is closed to new replies.