WordPress.org

Ready to get started?Download WordPress

Forums

Participants Database
[resolved] Multiple forms? (19 posts)

  1. 2koCreative
    Member
    Posted 1 year ago #

    Is it possible to have multiple forms on one site? I need a Registration Form and a Volunteer Form which each has very different data to collect. They can have their own page. thanks!

    http://wordpress.org/extend/plugins/participants-database/

  2. xnau
    Member
    Plugin Author

    Posted 1 year ago #

    2koCreative,

    To do this, you have to create two custom templates for your signup form. In each template, you'd have to control which fields were presented, and also set up dummy values in hidden inputs for fields that weren't presented but were required. Obviously, a good knowledge of PHP is required to pull this off.

  3. 2koCreative
    Member
    Posted 1 year ago #

    Unfortunately I do not much PHP experience. Would you have any other workaround? Or even slightly more detailed instruction on how to create a 2nd template? thanks!

  4. xnau
    Member
    Plugin Author

    Posted 1 year ago #

    This is a pretty deep customization of the plugin's functioning, so it does demand some programming knowledge.

  5. xnau
    Member
    Plugin Author

    Posted 1 year ago #

    I have an explanation of how to create custom templates here: http://wordpress.org/extend/plugins/participants-database/other_notes/

  6. 2koCreative
    Member
    Posted 1 year ago #

    Thank you! I was able to make the custom template per your instructions no problem.

    Now do you have any basic instruction on how to edit the form questions in this new template? (i.e.: Do I have to work strictly in the backend php files, or is it possible to edit this second template in the WP admin somehow?

  7. xnau
    Member
    Plugin Author

    Posted 1 year ago #

    If you've got your templates in your theme directory (and you should), you can edit them in your them editor. (Appearance/editor)

  8. 2koCreative
    Member
    Posted 1 year ago #

    ok, yes they are there. And I see where to edit them. Thanks. This will be my first time trying to edit my own php... so wish me luck! I guess I need to start learning this at some point! thanks for the guidance

  9. teamlovedesign
    Member
    Posted 1 year ago #

    xnau,

    First off, thanks for all of your hard work in developing this plugin. I hope I can get it to work with two forms. Here's what I've done so far.

    1. I duplicated a template and named it pdb-signup-custom1.php and pdb-signup-custom2.php.

    SIDE NOTE: Where does the file: pdb-signup-bootstrap.php play in all of this?

    2. I have my shortcode on one page as: [pdb_signup template="custom1"], and on another page called [pdb_signup template="custom2"].

    3. I created my database fields in field groups called "custom1 AND custom2".

    So, what code in the files: pdb-signup-custom1.php AND pdb-signup-custom2.php do I change to have my form fields assigned to my field group called "custom1 AND custom2" appear on my page using the shortcodes [pdb_signup template="custom1"] AND [pdb_signup template="custom2"]... respectively?

    I'm sure changing it on one template will apply for the other. I was just trying to be clear in asking my question.

    I'm baffled, and any assistance would be greatly appreciated.
    Thanks.

  10. xnau
    Member
    Plugin Author

    Posted 1 year ago #

    teamlovedesign,

    The answer is not so simple. For your idea to work, each template must have it's own way of determining which fields get shown. The plugin is not really set up to have multiple signups, so it's a little complicated.

    Here's the general idea. Remember, you'll have to adapt this to your situation, you won't be able to just paste it in and expect it to work.

    In the single template, after the $this->the_field(); statement, put something like this, with "group_name" changed to the name of the group you want to show:

    <?php if ( $this->group->name == 'group_name' ) : ?>

    OK, now the template will go as usual...then just before <?php endwhile; // fields put:

    <?php else : 
    
              if ( $this->field->validation == 'yes' ) echo '<input type="hidden" name="'.$this->field->name.'" value="0" />';
              else if ( $this->field->name == 'email' ) echo '<input type="hidden" name="'.$this->field->name.'" value="dummy@email.com" />';
    
              endif;
            ?>

    What that is doing, is it's inserting dummy values so that the fields that are not showing that need to be validated will pass validation. There is no way to turn off validation selectively in the template, so we have to do this. The 'email' field is an example of the kind of thing you'll have to do if you have other kinds of validation enabled.

    The 'bootstrap' template is just an example of a different way of setting up a template. The Twitter Bootstrap framework is something I'm interested in, so I created example templates that use that framework.

  11. teamlovedesign
    Member
    Posted 1 year ago #

    Awesome. This really gives me a foundation to work from. Thanks for taking the time to explain this to me. Much appreciated.

  12. msones
    Member
    Posted 1 year ago #

    xnau,

    Beautiful work, thanks.

    Quick question. I am creating templates for two sign up forms, but some of the fields overlap. How can I tell the template to pull from multiple groups?

    For example, I need Template1 to use fields from GroupA and GroupC, and Template2 to use fields from GroupB and GroupC.

    I think i'm just missing an OR somewhere in the php, just not sure how/where to include it. Thanks for the help!

  13. xnau
    Member
    Plugin Author

    Posted 1 year ago #

    Simple stuff. You just do something like this:

    <?php if ( $this->group->name == 'groupA' or $this->group->name == 'groupC' ) : ?>

    Make sure you spell it right! I didn't, probably.

  14. msones
    Member
    Posted 1 year ago #

    Got it! Thanks.

  15. martinahawkins
    Member
    Posted 1 year ago #

    I am trying to create similar templates. After I insert
    <?php else :

    if ( $this->field->validation == 'yes' ) echo '<input type="hidden" name="'.$this->field->name.'" value="0" />';
    else if ( $this->field->name == 'email' ) echo '<input type="hidden" name="'.$this->field->name.'" value="dummy@email.com" />';

    endif;
    ?>

    I get the error
    ( ! ) PARSE ERROR: SYNTAX ERROR, UNEXPECTED T_ELSE IN /U0/WEBROOT/VIRTUAL/WWW.NEWCASTLEAC.ORG/WP-CONTENT/THEMES/MYTWENTYELEVEN/TEMPLATES/PDB-SIGNUP-LEITRIM.PHP ON LINE 68
    CALL STACK

    Could you be of any assistance with this error?

  16. geoffreygordon
    Member
    Posted 1 year ago #

    I have a question, can you use this plugin to perform this kind of function:

    http://saiw.co.za/national_register/index.php?q=search&type=certification

  17. mpolfo
    Member
    Posted 10 months ago #

    Awsome plugin!!!
    This is what i am looking for!!!
    thank you!!
    I have create 2 forms with your help and i want to ask howto saw the list of second form?
    and all this must do and for records?and single?

    and again excellent work
    thank you!!!!

  18. Linda Fong
    Member
    Posted 9 months ago #

    xnau,

    Thank for all the tips. How do i unsubscrbe from this forum?
    Thanks.

  19. xnau
    Member
    Plugin Author

    Posted 9 months ago #

    @mpolfo - there are several ways to do this, but perhaps the best is to use a hidden field that captures the page name the form is on. Then, then you want to show the list of submissions from that form, use a filter in the list shortcode that only shows records with that page name. The details of how to to that re here under "hidden signup fields"

    @Linda Fong - huh...I don't really know. there is probably a help page on that somewhere on this site. It's not something I can do for you.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.