• Hi,

    I have the issue, that my checkbox fields aren’t checked anymore when a form validation is thrown.
    Multiselect checkboxes work like a charm, just single Checkboxes have this problem. When I print_r($_Post), then I can see that the values are there but the form elements don’t interpret them right.

    I have a custom template and I use the $this_form->print_title(‘somefield’); function.

    Thx for your help!
    Dan

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

    (@xnau)

    I’m not able to reproduce the problem, so I’ll need more info.

    What is the setting you have for the “values” parameter of your checkbox?

    Is your checkbox a required field?

    Thread Starter Ghostflasher

    (@ghostflasher)

    The value is just “yes” and it is not required.

    Plugin Author xnau webdesign

    (@xnau)

    Since this normally works, I suspect there may be an issue with the template.

    If you are using the PDb_Template class, you can use the print_form_element method to print your form element:

    $this_form->print_form_element('somefield');

    Or you can use the default method provided in the default template

    Maybe you could post the part of your template that does the printing of the form elements.

    Thread Starter Ghostflasher

    (@ghostflasher)

    sorry, that is what I use. I copied the wrong function in my first post (label instead of form_element).

    Here is an example:

    `<div class=”inline-block”><?php $this_form->print_form_element(‘field1’); ?></div>
    <label class=”control-label inline-block”><?php $this_form->print_title(‘field1’); ?></label>

    Plugin Author xnau webdesign

    (@xnau)

    Are you doing anything to the $_POST array?

    Thread Starter Ghostflasher

    (@ghostflasher)

    Doing nothing to it. Just reading it out.

    $x = $_POST['something'];

    or

    print_r($_POST);

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

The topic ‘checkboxes not checked anymore after validation error’ is closed to new replies.