Setting Date Format with Javascript
Posted: Mon Jun 19, 2017 3:06 am
Hi, Since I could not figure out how to handle date in sdk, I found that with Javascript I can get the Category of Date, and the Format string to show, but I cannot make the dropdown for the field become visible.
FN = "Text1" for example
JS = "var f = this.getField(""" & FN & """); f.setAction(""Format"",""AFDate_FormatEx(\""mm/dd/yyyy\"");"");"
Call Me.PDF.Inst.ExecuteJS(Me.PDF.Doc, JS, PAEC_Field, PAESC_Exec, Nothing, Result)
JS = "var f = this.getField(""" & FN & """); f.setAction(""Keystroke"",""AFDate_KeystrokeEx(\""mm/dd/yyyy\"");"");"
Call Me.PDF.Inst.ExecuteJS(Me.PDF.Doc, JS, PAEC_Field, PAESC_Exec, Nothing, Result)
Dim FField As IPXC_FormField
Set FField = Me.PDF.Doc.CoreDoc.AcroForm.GetFieldByName(FN)
FField.Flags = TFF_Date
Call Me.PDF.Doc.FireFieldChangedEvent(FField)
the formatting works, but no dropdown shows, any solution for that?
ce
FN = "Text1" for example
JS = "var f = this.getField(""" & FN & """); f.setAction(""Format"",""AFDate_FormatEx(\""mm/dd/yyyy\"");"");"
Call Me.PDF.Inst.ExecuteJS(Me.PDF.Doc, JS, PAEC_Field, PAESC_Exec, Nothing, Result)
JS = "var f = this.getField(""" & FN & """); f.setAction(""Keystroke"",""AFDate_KeystrokeEx(\""mm/dd/yyyy\"");"");"
Call Me.PDF.Inst.ExecuteJS(Me.PDF.Doc, JS, PAEC_Field, PAESC_Exec, Nothing, Result)
Dim FField As IPXC_FormField
Set FField = Me.PDF.Doc.CoreDoc.AcroForm.GetFieldByName(FN)
FField.Flags = TFF_Date
Call Me.PDF.Doc.FireFieldChangedEvent(FField)
the formatting works, but no dropdown shows, any solution for that?
ce