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:

  1. Perform some calculation in code.
  2. 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

C.E.A created an issue. See original summary.

c.e.a’s picture

Issue summary: View changes
jrockowitz’s picture

Status: Active » Closed (won't fix)

This should be done via custom code. You can detect when a webform is loaded via Ajax and alter the form.