Expand my Community achievements bar.

changing the field type

Avatar

Level 2

Hi,

I have two requirements

  1. I have a table in a dynamic pdf form. And in the table have put a signature field in one of the cells. My question is , can I change the field type programmatically into a text field. The requirement is, if the user does not want to do an adobe esign, there is button next to the table, and the user can click on that, and in the signature field , instead of signature , the text will display "rejected by the manager".
  2. There is one more table with the same layout , but here if the user clicks on the button next to the table, I want to insert a predefined adobe signature into the signature field.

    All helps are appreciated.

Thanks

7 Replies

Avatar

Former Community Member

No you cannot change field type on the fly. You could have it there already (hidden) and make it visible when the user indicates that they want a signature though.

Paul

Avatar

Level 2

Thanks Paul for your reply .

I tried to do that . But I could place only one field on the table cell. Once I put a text filed on top of the signature field it replaces the signature field. The same case, if I have a text field  on the table cell, once I put a signature field on top of that , it replaces the text field. Ay idea how to pu them together ? Also One more thing , I tried to parse the signature field , I could get the name of the person who signed it but could not get the date , here is my code

var Info = event.target.getField("form1[0].page1[0].Table1[0].Row1[0].SignatureField1[0]").signatureInfo()

var certificate = Info.certificates[0];

page1.Table1.Row1.Name1.rawValue = certificate.subjectCN;

app.alert(Info.date);

page1.fld2.rawValue = Info.date;

although the alert message shows the date in this format

"Tue Oct 18 2011 08:55:42 GMT-0700(Pacific Daylight Time)"

but the code

page1.fld2.rawValue = Info.date;

does not do anything, in the preview mode, it says "Empty" in the field .  Any idea, how to get the date part ?

Thanks

Avatar

Level 10

Create a positioned subform outside the table with the signature field and the hidden text field at the same position within the subform.

Then drag and drop those subform into the desired table cell.

Avatar

Former Community Member

Does the date appear in teh app alert? I tried it here and I was able to retrieve the dte from the signature without issue.

Paul

Avatar

Level 2

HI Paul,

Thanks for your reply. I formatted the date and assigned it into the date field. And it looks fine now. One more question thuogh, any odea how to insert a predefined signature into the signature field  ? Here is my requrement .

"There is a signature field and a butto next to the signature field . The user can click on the signature field to put an adobe esign , but if the user clicks on the button next to the signature field, I want to insert a predefined adobe signature into the signature field.

Here is what I tired, but it does not work

var sigFieldName = event.target.getField("form1[0].page1[0].SignatureF ield1[0]")

var myEngine = security.getHandler("Adobe.PPKLite")

app.alert("executed1") // this alert does not display , that means I guess the above line does not work. coz once I comment the above line and the lines below, the alert shows up .

myEngine.login("sign123", "/c/sign/Sign.pfx");

sigFieldName.signatureSign(myEngine, {password: "sign123"});

Avatar

Level 2

Thanks for the reply , i got rid of the table and just put the textfield and signature overlapping each other . Thanks for your suggestion.  I have an other requirements, if you could shade any light . I have written above in reply to Pauls suggestions.

Thanks

Avatar

Former Community Member

You cannot programmatically sign for the user ...that kind of defeats the purpose. You can seed the signature field with display values but the user still has to physically click the signature and choose the cert they want to sign with (or other means of signing).

Paul