Hold that submission!
Working with forms is a great way to add a way for your visitors, customers and others reach out to you. This is quite useful and often needed. What happens though when you have a video recorder and form is submitted. How do you make sure that video is included?
Well when you are using Ziggeo that is a very simple thing to do really. There are several ways to do it and we have it built into our system.
What happens in form, saves as your data
When you record the video by default the videos are sent to our servers. Based on your settings and setup there might be some other steps happening afterwards. Now there is a parameter that you can add to your recorder to make sure that you get the token saved. This way as the video is sent to our server it is also added to your form fields.
We would generally suggest to add this field as hidden field. One example of such can be:
<input type="hidden" id="ziggeo_video" name="ziggeo_video">
The important part of course would be to have that hidden field within your form element. If it is outside it might not be submitted. This greatly depends on how you are submitting the form, however that is a theme of its own.
OK, so now that we know what your hidden field within the form could look like let us see what kind of embedding code we could use:
<ziggeorecorder ziggeo-theme="cube" ziggeo-themecolor="red" ziggeo-width="100%" ziggeo-input-bind="ziggeo_video"> </ziggeorecorder>
That is it. Your recorder will use the name you have added into the input-bind
parameter to find the hidden field. As it finds the same, it will add the token as its value. So every time your form is submitted the video token will be saved with other data in there.
Making video required
You can make various fields on your form as required, however how would you go about it using your Ziggeo recorder? Well it might sound hard, yet it is super easy to do. We just use one more parameter. This one is called form-accept
.
This parameter expects that you pass the ID of the form so that it can find it. As it is created it immediately starts listening to form submission and will stop it from happening. That is unless there is a video recorded first.
So let us take a look at the example form:
<form id="myform" method="post"> <!-- some HTML code goes here --> </form>
As this forms ID is myform all that we would need is to change the recorder above to the following:
<ziggeorecorder ziggeo-theme="cube" ziggeo-themecolor="red" ziggeo-width="100%" ziggeo-input-bind="ziggeo_video" ziggeo-form-accept="#myform"> </ziggeorecorder>
And that is it. With this setup the form can not be submitted until you record the video. Also the video token will always be saved with the other data you have captured.