Skip to:
Content
Pages
Categories
Search
Top
Bottom

Only show required fields on signup form


  • peterverkooijen
    Participant

    @peterverkooijen

    This has probably been asked a million times, but I can’t find it: Is there a built-in way to only show the required fields on the initial signup form and leave the rest for the profile editing form?

    What’s the best way to hide the non-required fields? I’ll now resort to CSS trickery…

    EDIT: Running into problems with CSS trickery. I can hide the input fields using their ID’s (“field_3” etc.), but then I still get the labels. The labels only have this:

    <label class="signup-label" for="field_3">

    Can I somehow use that “for=” in CSS?

    I can’t hide the whole signup-field block, because field_1 and field_2 are required. I can’t hack CSS id’s or classes into core files, because the labels and inputs are generated by script.

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

  • r-a-y
    Keymaster

    @r-a-y

    You could use jQuery to select the “for” attribute so you can hide it.

    Read up on jQuery selectors:

    http://docs.jquery.com/Selectors/attributeEquals

    Try this:

    <script type="text/javascript">
    $(document).ready(function(){
    $("label[for='field_3']").css({'display' : 'none'});
    });
    </script>

    You’ll need to have the jQuery library somewhere in your HTML source.


    peterverkooijen
    Participant

    @peterverkooijen

    Thanks r-a-y!

    I like jQuery. I already use it for several other things, so this looks like a good solution.

    I hope a more built-in solution will be added to coming versions of Buddypress.


    nicolagreco
    Participant

    @nicolagreco

    Yep. jQuery is a good solution, but the code is ever in the page, with that code the label you don’t want is hidden, so it’s still in the page.

    Then, it depends if it satisfate you :)


    peterverkooijen
    Participant

    @peterverkooijen

    I can live with in this case, but let us know if you have a better solution. ;-)

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Only show required fields on signup form’ is closed to new replies.
Skip to toolbar