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
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
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.
Thank you very much!
You must log in to post.