How to hide a custom button when you export to pdf
I have created a custom button which will export my form to PDF, however the button itself is included on the pdf, how do I remove the button so it doesn't appear in the exported PDF.
I am currently using on the button onclick - fd.saveAsPDF('filename');
Also each of my forms will have a unique number assigned to it, is there a way to change the 'filename' of the PDF so that it is dynamic to that certain unique numbered field in my form
Thanks
I am currently using on the button onclick - fd.saveAsPDF('filename');
Also each of my forms will have a unique number assigned to it, is there a way to change the 'filename' of the PDF so that it is dynamic to that certain unique numbered field in my form
Thanks
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi,
1. Assign a Css Class to the button, ex.: export-button.
2. Insert the code into OnClick property:
Replace FieldName with the internal name of the field containing the unique number.
1. Assign a Css Class to the button, ex.: export-button.
2. Insert the code into OnClick property:
Code: Select all
$('.export-button').hide();
fd.saveAsPDF(fd.field('FieldName').value())
.done(function() { $('.export-button').show(); });
Brilliant, thank you this worked PERFECT!!
if I want my button to open up a display form in a dialog as well, where about and what would I include to the code you supplied
$('.export-button').hide();
fd.saveAsPDF(fd.field('FieldName').value())
.done(function() { $('.export-button').show(); });
Thank you again
if I want my button to open up a display form in a dialog as well, where about and what would I include to the code you supplied
$('.export-button').hide();
fd.saveAsPDF(fd.field('FieldName').value())
.done(function() { $('.export-button').show(); });
Thank you again
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi,
Do you want to open a dialog after saving the form into PDF?
Do you want to open a dialog after saving the form into PDF?
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi,
Open the display form with fd.openForm method, ex.:
And call fd.saveAsPDF method in the display form.
https://spform.com/documentation/js/manager
Open the display form with fd.openForm method, ex.:
Code: Select all
fd.openForm('fd_Item_Display.aspx');
https://spform.com/documentation/js/manager
-
- Information
-
Who is online
Users browsing this forum: No registered users and 3 guests