Grow your CSS skills. Land your dream job.

Checkbox with link which make appear a paragraph in a form

  • # May 5, 2013 at 4:20 pm

    I’m working on a form and I need to do this: [http://www.isoluxcorsan.com/es/contacto/](http://www.isoluxcorsan.com/es/contacto/ “http://www.isoluxcorsan.com/es/contacto/”) I refer to the checkbox with link, which when clicked open a text paragraph.

    Sorry for the name of the topic but I really don’t know how to call it better.

    Thanks in advance, Kevin.

    # May 5, 2013 at 6:50 pm

    You can use jQuery.

    Target the checkbox, and when it is clicked, toggle a css class on the paragraph you want to show/hide.

    $(‘input#valorpolitica’).click(function(){

    $(‘#LOPD’).toggleClass(‘hide-with-script’);

    });

    # May 10, 2013 at 4:29 am

    Hi hotpink,

    Thanks for your response, but can you be more specific please? I’m not good with Javascript…

    # May 13, 2013 at 7:26 am

    I think I got the important stuff working, but I need to add a page onload and I don’t know how, Can anyone tell me how to do it please?

    Check out this Pen!

    # May 13, 2013 at 9:15 am

    Easiest way is to append this to your JS: `window.onload = ocultartexto;`

    By the way you have a parameter in that function you aren’t using, might as well remove it.

    `if(conformidad.checked==true)` => `if(conformidad.checked)`

    # July 4, 2013 at 1:07 pm

    It worked CrocoDillon, thanks.

Viewing 6 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".