Support » Plugin: Participants Database » Templates stuck on validation

  • I really, really want to make this plugin work. I appreciate the simplicity and straightforward design.

    I’ve followed this page to create templates for different registration forms. I can get the two different templates to display correctly, but I’m having problems with validation still.

    Here’s the situation: I have Template A, which has questions 1, 2, and 3. I also have Template B, which has questions 4, 5, and 6. They’re all required.

    What happens is when I try to register on Template A (completing questions 1, 2, and 3), I get error messages for questions 4, 5, and 6. And the reverse is also true: When I try to register on Template B (completing questions 4, 5, and 6), I get error messages for questions 1, 2, and 3.

    I’ve tried to use the validation bypass code you pasted in the other thread:

    <?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;
            ?>

    This doesn’t do anything for me. I’ve tried to tweak that in every way I can think of, without success.

    The fields that require validating are drop downs, radio buttons, and checkboxes.

    Any help is very much appreciated.

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

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author xnau webdesign

    (@xnau)

    aikorei,

    Well, the simple workarounds I provided for other users to do what you’re doing here just won’t cut it for your more complex task.

    I’m working on an update that will be out in a week that fixes this…fields that aren’t included in the form submission are not validated at all, so no need to supply a dummy value, just skip over the fields you don’t want to show and you’ll be good.

    Thread Starter aikorei

    (@aikorei)

    Bless your soul, xnau. =) Thanks very much for this timely update. I was on the verge of just writing my own forms and inserting the data into the participants database table so I could still view the data in the WP admin area.

    I hate asking for a delivery date – I know stuff happens – so I’ll ask this instead: How confident are you that it’ll be out in a week? I need to make something happen 10 days from now, so I’m wondering if I should get started on my own forms ‘just in case’.

    Thanks for making such an outstanding plugin.

    Plugin Author xnau webdesign

    (@xnau)

    aikorei,

    Pretty sure it will be out in a week, but I’ll provide you with an interim fix so your timing won’t be so tight.

    In the file classes/FormValidation.class.php on line 247, you’ll find:

    if ( empty( $validation ) || NULL === $validation || 'no' == strtolower( $validation ) ) return;

    Change this to:

    if ( empty( $validation ) || NULL === $validation || 'no' == strtolower( $validation ) || NULL === @$this->post_array[$validation] ) return;

    That will skip validation on any field not included in the submission.

    Thread Starter aikorei

    (@aikorei)

    Fantastic, thanks so much! It works perfectly.

    I really appreciate your time.

    Now I just need to work on the pdb-record template so the right fields are shown, but I think I can handle this.

    Thread Starter aikorei

    (@aikorei)

    I spoke too soon. I can now submit a form without completing any fields…in other words the validation doesn’t seem to work at all.

    I can probably work around this and only validate the common/main group without requiring validation of the unique groups for the time being.

    Thanks again.

    Plugin Author xnau webdesign

    (@xnau)

    Oh, my mistake… this is the correct line to put in:

    if ( empty( $validation ) || NULL === $validation || 'no' == strtolower( $validation ) || NULL === @$_POST[$name] ) return;

    That’ll teach me to send stuff out without testing it!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Templates stuck on validation’ is closed to new replies.