Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #999701

    I have created a form with a number of check-boxes (actually, quite a lot of them) as you can see here https://oreflow.com.au/request-free-quote/.
    When a user checks one of the boxes, the resulting email looks something like below. Is there a way to make it so that ONLY the items that are checked in the form are sent through, rather than showing ‘false’ on all other fields that weren’t ticked?

    Name: Benny
    E-Mail: NAME
    Phone: PHONE
    Company: COMPANY
    Trough Idlers: false
    Impact Idlers: false
    Return Idlers: false
    Poly Idlers: false
    Trough Frames: false
    Training Frames: false
    Adjustable Frames: false
    Return Roller Brackets: false
    Primary Scrapers: false
    Secondary Scrapers: false
    Ploughs: false
    Skirting Systems: false
    Belt Support Systems: false
    Air Cannons / Flow Activators: false
    Jaw Crushers: false
    Cone Crushers Secondary & Tertiary: false
    Spare Parts for Jaw Crushers: false
    Keyliner Chute Lining Systems: false
    Rubber Impact Elements: false
    Rubber backed ceramic tiles: false
    Head: false
    Tail: false
    Take Up: false
    Refurbishment: false
    Lagging: false
    Apron Feeder: false
    Vibratory Pan Feeders: false
    Rubber Screencloths: false
    Poly Panels: false
    Wide Screencloths: false
    Capping Rubber: false
    Dust Cloth: false
    Other Dust Sealing Components: false
    Hot Lining System: false
    Cold Lining System: false
    Wet Screens: true
    Screen Furbishment: false
    Bucket Elevators: false
    Dry Screens: false
    Conveyor System: false

    #1000531

    Hey shanhard,

    Please post us your login credentials (in the “private data” field), so we can take a look at your backend.

    1. Install and activate ” Temporary Login Without Password “.
    2. Go to ” Users > Temporary Logins ” on the left-side menu.
    3. Click ” Create New “.
    4. Add the email address for the account ( you can use (Email address hidden if logged out) ), as well as the ” Role ” making that the highest possible and the expiry about four days
      ( do be sure that we have enough time to debug ).
    5. Click ” Submit “.
    6. You’ll now have a temporary account. Please provide us here in the private section the URL, so we can login and help you out.

    When your issue is fixed, you can always remove the plugin!
    If you prefer to not use the plugin, you can manually create a admin user and post the login credentials in the “private data” field.

    Best regards,
    Basilis

    #1000831

    Details added to private. Thanks for your attention.

    #1001850

    Hi,

    I added this code to your child theme functions.php to solve the issue:

    
    add_filter('avf_form_mail_form_field', 'avia_change_checkbox_form_values', 10, 7);
    function avia_change_checkbox_form_values($form_field, $new_post, $form_elements, $form_params, $element, $key, $field_value)
    {
    	if($field_value == 'false') $form_field = '';
    	return $form_field;
    }
    
    

    I also had to patch the enfold/framework/php/class-form-generator.php with a new filter (modified code: https://pastebin.com/raw/k4KiZK0z ).

    The next theme update should include the patched class-form-generator.php and the child theme code will also work with future updates.

    Best regards,
    Dude

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.