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

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Print button


  1. zbilic
    Member

    Is there a way to add Print button on the form and hide Submit button. The form is in iframe and I just need a Print button instead of Submit on one of our forms.

    Thanks

    Posted 16 years ago #
  2. yuniar

    Ok, let say you would like to show print button for your form which has id = 8
    Edit your includes/view-functions.php file, around line 1576 - 1583 you'll find this code:

    ---------------------------------

    //markup for submit button
    $button_markup =<<<EOT
    <li class="buttons">
    	    <input type="hidden" name="form_id" value="{$form->id}" />
    	    {$edit_markup}
    	    <input id="saveForm" class="button_text" type="submit" name="submit" value="Submit" />
    </li>
    EOT;


    ---------------------------------
    Replace that code with this one:
    ---------------------------------

    if($form_id == 8){
    	$submit_button = '<input class="button_text" type="button" name="print" value="Print" onClick="window.print()"/>';
    }else{
    	$submit_button = '<input id="saveForm" class="button_text" type="submit" name="submit" value="Submit" />';
    }
    //markup for submit button
    $button_markup =<<<EOT
    <li class="buttons">
    	    <input type="hidden" name="form_id" value="{$form->id}" />
    	    {$edit_markup}
    	    {$submit_button}
    </li>
    EOT;


    ---------------------------------
    That would do it. Don't forget to adjust the id number.


    MachForm Founder

    Posted 16 years ago #
  3. zbilic
    Member

    Thank you very much!

    Posted 16 years ago #

RSS feed for this topic

Reply