Hello,

I try to set the visibility property /(button.Visibility =
PushbuttonField.VISIBLE_BUT_DOES_NOT_PRINT;)/. It works fine, but sometimes
few users click more than once, then the form is send and the button appears
on the PDF document.
I want to set the button to disabled after the click-event using JavaScript
(/submit.SetAdditionalActions (PdfName.D, PdfAction.JavaScript
("this.getField ('Submit'). Disabled = true ));", writer));/).

Any ideas? 

This is the source code: 

private static PdfFormField GetPushbuttonField(PdfWriter writer, Rectangle
box, string fieldName, string text, string submitUrl)
        {
            PushbuttonField button = new PushbuttonField(writer, box,
fieldName);
            button.Text = text;
            button.BackgroundColor = new
Color(System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.ButtonFace).ToArgb());
            button.BorderStyle = PdfBorderDictionary.STYLE_BEVELED;
            button.FontSize = 12;
            button.BorderColor = new
Color(System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.ButtonHighlight).ToArgb());
            button.Visibility = PushbuttonField.VISIBLE_BUT_DOES_NOT_PRINT;
            PdfFormField submit = button.Field;
            submit.Action = PdfAction.CreateSubmitForm(submitUrl, null,
PdfAction.SUBMIT_XFDF);
            if (fieldName == "Submit")
            {
                submit.SetAdditionalActions(PdfName.D,
PdfAction.JavaScript("this.getField('Submit').disabled = true));", writer));
            }
            return submit;
        }

--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/VISIBLE-BUT-DOES-NOT-PRINT-tp4340832p4340832.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to