PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Multiple forms

  1. iamcanadian1973
    Member

    I am running mutiple forms on a single page, they all submit and then force dowenload a pdf.

    When I had a single form it was working, then I added additional forms and the dowenload stopped working.

    Just as an example since you can't see the php code

    add_filter("gform_validation_message_2", "change_message", 99, 2);
    add_filter("gform_ajax_spinner_url_2", "spinner_url", 10, 2);
    
    add_action("gform_post_submission_2", "post_submission_2", 99, 2);
    
    function change_message($message, $form){
        return '';
    }
    
    function spinner_url($image_src, $form){
        return "";
    }
    
    function post_submission_2($lead, $form) {
    
    	$data = '/pdf/DesignGuide.pdf';
    	$name = 'MegaDome-Design-Guide.pdf';
    
    	force_download($name, $data); 
    
    }

    Everything works as expected, except now for some reason the pdf if around 20kb, which is just an empty corrupt pdf.

    I haven't changed anyhting else except the forms, so I'm not sure whast it could be.

    any thoughts?

    Posted 12 years ago on Monday September 12, 2011 | Permalink
  2. iamcanadian1973
    Member

    Please ignore this question, I have no idea why its happening, but I'm sure I'm a bit too vague for anyone to help.

    Posted 12 years ago on Monday September 12, 2011 | Permalink
  3. force_download() is Code Igniter functionality correct? This could be something related to Code Igniter code usage.

    Posted 12 years ago on Monday September 12, 2011 | Permalink