@@ -42,22 +42,51 @@ <h5 id="webforms-heading">The web form has been embedded below using the DocuSig
4242 minHeight : "1500px" ,
4343 } ,
4444 // Controls the auto resize behavior of the iframe
45- autoResizeHeight : true ,
46- // These values are passed to the iframe URL as query params
47- tracking : {
48- "tracking-field" : "tracking-value" ,
49- } ,
50- //These values are passed to the iframe URL as hash params
51- hidden : {
52- "hidden-field" : "hidden-value" ,
53- } ,
45+ autoResizeHeight : true
5446 } ;
5547
5648 const webFormWidget = docusign . webforms ( {
5749 url : '{{ url }}' ,
5850 options : webFormOptions ,
5951 } ) ;
6052
53+ //Basic milestones in this workflow
54+ webFormWidget . on ( 'ready' , ( event ) => {
55+ // event = { type: 'ready' };
56+ console . log ( 'debug form loaded' , event ) ;
57+ } ) ;
58+
59+ webFormWidget . on ( 'submitted' , ( event ) => {
60+ // event = { type: 'submitted', envelopeId: 'abcd1234' };
61+ console . log ( 'debug form submitted' , event ) ;
62+ } ) ;
63+
64+ webFormWidget . on ( 'signingReady' , ( event ) => {
65+ // event = { type: 'submitted', envelopeId: 'abcd1234' };
66+ console . log ( 'debug form signingReady' , event ) ;
67+ } ) ;
68+
69+ webFormWidget . on ( 'sessionEnd' , ( event ) => {
70+ //There are 3 sessionEnd types sessionTimeout, remoteSigningInitiated, signingResult
71+
72+ // event = { type: 'sessionEnd', sessionEndType: 'sessionTimeout' };
73+ // event = {
74+ // type: 'sessionEnd',
75+ // sessionEndType: 'signingResult',
76+ // signingResultType: 'signing_complete',
77+ // returnUrl: 'bigcorp.com',
78+ // envelopeId: 'abcd1234',
79+ // };
80+ // event = { type: 'sessionEnd', sessionEndType: 'remoteSigningInitiated', envelopeId: 'abcd1234' };
81+ console . log ( 'debug form signingResult' , event ) ;
82+ } ) ;
83+
84+ //Less commonly used events
85+ webFormWidget . on ( 'userActivity' , ( event ) => {
86+ // event = { type: 'userActivity', activityType: 'click' | 'keydown' };
87+ console . log ( 'debug form userActivity' , event ) ;
88+ } ) ;
89+
6190 webFormWidget . mount ( "#docusign" ) ;
6291 }
6392 loadWebform ( ) ;
0 commit comments