Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I make reference to <Form /> from external javascript code ? #534

Closed
ansonchau2007 opened this issue Aug 30, 2023 · 1 comment
Closed

Comments

@ansonchau2007
Copy link

I have an external button which will call API to populate values to formio fields

const prefillHandler = () => {
    // call API an get result
    // form.getComponent('firstName').setValue(result);
  };
...
<Button onClick={prefillHandler} >Prefill</Button>
<Form
              src={"https://examples.form.io/example"}
              onSubmit={onSubmitHandler} 
 />

How can I do to make reference to the form in my function prefillHandler ?

Thank you

@ansonchau2007
Copy link
Author

ansonchau2007 commented Sep 18, 2023

This has been solved. Issue closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant