Trouble Posting MultiCheckbox Array Data to Email

Home Forums Quform PHP Trouble Posting MultiCheckbox Array Data to Email

This topic is: not resolved
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #18819
    rauschusa
    Participant

    Hello,
    I am trying to write a carefully scripted email by displaying Submitted Form Data within an html email’s code – and that’s going well. Except that when I try to post data from a multi checkbox array by using getValueHtml instead of getValue, I get a fatal error.

    Fatal error: Call to undefined method Quform_Element::getValueHtml() in /home/…/rauschusa/quform/lib/Quform3.php on line 180

    And if I use getValue, the email generates a different error in the email text.

    Warning: htmlspecialchars() expects parameter 1 to be string, array given in /home/../rauschusa/quform/lib/Quform3.php on line 215

    In the error code, I can see that the form was writing the email fine, and has pulled the data from the preceding input, then stops abruptly at the first multi checkbox. And if I use getValue for the entire email, every normal input feeds into the email well, but all of the multi checkboxes return the line 215 error.

    The email code:
    <b>Product Applications:</b> <?php echo Quform::escape($form->getValueHtml('product'));?>

    Sample from form code:

    <div class="quform-option">
                                        <label><input name="product[]" class="checks" value="Mainline Inspection" type="checkbox" />
                                          Mainline Inspection</label></div>
                                        <div class="quform-option">
                                        <label><input name="product[]" class="checks" value="Crack Measurement Upgrade" type="checkbox" /> 
                                        Crack Measurement Upgrade</label> 
                                        </div>

    Process code:

    $product = new Quform_Element('product[]', 'Applications for your system');
    $product->addValidator('required');
    $form->addElement($product);

    I renamed the Quform.php file, but it’s the 06/2015 file, I changed the name to make sure I do not break old Quforms that I wrote with the 2012 or 2014 editions I have used.

    Please let me know what I am doing wrong and how I can get this running. Thanks.

    • This topic was modified 8 years, 6 months ago by rauschusa.
    #18827
    Ally
    Support Staff

    You don't have permission to view this content. Please log in or register and then verify your purchases to gain access.

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy