This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 3

Add Print Button next to submit


  1. rosbal2013
    Member

    Will be possible to add a print button, so that they can print before submitting the form to get a hardcopy of their submission.

    Posted 11 years ago #
  2. redityo

    Hi,

    I think, it would be better to add the print button on review page, so the user can print the submitted entry before completely submit the form.
    To do this, you need to turn on "show review page" on form properties.
    Then, edit "includes/view-functions.php" file and go to around line 6002 ~ 6012, you will see these codes :

    if(!empty($form_review_use_image)){
    			$button_markup =<<<EOT
    <input id="review_submit" class="submit_img_primary" type="image" name="review_submit" alt="{$form_review_primary_text}" src="{$form_review_primary_img}" />
    <input id="review_back" class="submit_img_secondary" type="image" name="review_back" alt="{$form_review_secondary_text}" src="{$form_review_secondary_img}" />
    EOT;
    		}else{
    			$button_markup =<<<EOT
    <input id="review_submit" class="button_text btn_primary" type="submit" name="review_submit" value="{$form_review_primary_text}" />
    <input id="review_back" class="button_text btn_secondary" type="submit" name="review_back" value="{$form_review_secondary_text}" />
    EOT;

    then you can change it to

    if(!empty($form_review_use_image)){
    			$button_markup =<<<EOT
    <input id="review_submit" class="submit_img_primary" type="image" name="review_submit" alt="{$form_review_primary_text}" src="{$form_review_primary_img}" />
    <input id="review_back" class="submit_img_secondary" type="image" name="review_back" alt="{$form_review_secondary_text}" src="{$form_review_secondary_img}" />
    <input class="button_text btn_secondary" type="button" name="Print" value="Print" onClick="javascript:window.print();" />
    EOT;
    		}else{
    			$button_markup =<<<EOT
    <input id="review_submit" class="button_text btn_primary" type="submit" name="review_submit" value="{$form_review_primary_text}" />
    <input id="review_back" class="button_text btn_secondary" type="submit" name="review_back" value="{$form_review_secondary_text}" />
    <input class="button_text btn_secondary" type="button" name="Print" value="Print" onClick="javascript:window.print();" />
    EOT;

    MachForm Support

    Posted 11 years ago #
  3. rosbal2013
    Member

    Thank you very much. It worked. I don't know about php but i want the print to look like an image and not text.

    Posted 11 years ago #
  4. wallahed
    Member

    It works just fine. BUT it would be better if the print option was on the form property tab for EACH form so that if the review before submit is checked, the print is shown as an option.

    Posted 11 years ago #
  5. sanevoice
    Member

    Hi: I want to add a print button as well and am using Machform 3.5, but there are only 2495 lines of code in the includes/view-functions file. Am I missing something here??? Thanks

    Posted 9 years ago #
  6. spresser
    Member

    I would also like to add this. When I replaced the code it resulted in errors. Is there an update to this code?

    Posted 8 years ago #

RSS feed for this topic

Reply