The below link will open the webform (New Ticket) in a dialog and prepopulate its fields with some data:
<a href="/form/new-ticket?uid={{ field_uid }}&nid={{ field_nid }}" class="btn btn-success btn-lg webform-dialog webform-dialog-normal">Submit</a>
I would like to once a user will click the above link:
- Perform some calculation in code.
- Then set the value of a text field element on that webform = to the calculation result.
A CustomWebformHandler.php file can do the job but I beleive the function to be fired while loading the webform in the dialog is missing !
It will be helpful to have such function available.
Thank you,
Comments
Comment #2
c.e.a commentedComment #3
jrockowitz commentedThis should be done via custom code. You can detect when a webform is loaded via Ajax and alter the form.