Hi All,
I have a wix form, it seems to have two IDs $w('#wixForms1') and $w('#form1') and both of these in the page code give "is not a valid selector". I realise I'm doing something rookie but a decent amount of searching has turned up zero.
I am looking for a form.OnSubmit() or .OnSave(). While googling I've seen dataset.OnAfterSave() but I don't appear to have a dataset.
Bigger picture, this is an appointment booking form and what I am trying to accomplish is to generate two emails on a single form submit, one to my customer, and one to the relevant store manager (store email is held as a value of the store drop down). I set up one automation that works fine for the customer, but I can't see how to make a second automation that takes the email from the store drop down and notifies the store. I thought ok, lets just sidestep the complex part, I'll just make a second hidden form that clones the values of the first and launches a new automation to email the store. regards,
Dave
Hi Dara,
After closing/restarting my browser the 'not a valid selector' has gone away. Fantastic. We are getting closer. I can now add in the event handler for the form1 submission.
So now all that remains is submitting form2 programatically. I can't see anything on the button2 or form2 selectors that lets me submit programatically. Is there a way?
thanks,
Dave
Hi Dave,
When setting up an automation to send a notification about a form submission you can only choose one email address to send it to. If you want to send an email to a certain email address depending on a dropdown value you will have to use a 3rd party API. Triggered emails can only be sent to currently logged-in users so that also won't work.
I tried to recreate your issue with the form IDs, but I am unable, when I add them to your code they are both valid selectors.
Data binding and coding is not necessary, we do not recommend having both data binding and code added to the same elements.
I noticed the onClick() function you set it is just taking the values of the input fields and adding them to different input fields.
If you are trying to take the values of the form submission and add them to a database collection you will have to use the insert() function from the wix-data API.
Hope this helps!
Dara | Corvid Team
Hi Dave,
For sending emails after a form submission you will probably find this article helpful.
Corvid Tutorial: Sending an Email on Form Submission
Regarding the issue with the form IDs could you send us a snippet of your code and a link to your site, so we can take a closer look?
There is no form onSubmit function but you could use the submit buttons onClick() function.
Hope this helps!
Dara | Corvid Team