Save data in field

penny 13 Apr, 2016
Hi.
I have my form open in a pop up shadow box, is it possible to save the information that I have filled out so when I close the shadow box and reopen it the information is in the fields still?

Thanks
Penny
GreyHead 14 Apr, 2016
Hi Penny,

You can do this with the Data to Session and Session to Data actions. Depending on exactly what you need to do you may need some custom code to clear some or all of the values.

Bob
penny 14 Apr, 2016
I would just like it to be when I click on my order now button and my form pops up in the shadow box, if I accidentally click off the shadow box the form leaves and removes the fields I entered. If I click the Button again to retrieve the form, I would like the information I filled in to still be there. All the information I want saved is text field boxes, Like name, email, address, etc.

Thanks
Penny
GreyHead 14 Apr, 2016
Hi Penny,

If you accidentally close the form then the data hasn't been saved by ChronoForms so can't be reloaded. Can you use a modal window that can't be accidentally closed?

Bob
penny 14 Apr, 2016
Well at first I was using the Nonumbers Modal for the shadow box, but it seemed to be stripping something out as my validation on the forms were no longer working - so I have switched it to the shadowbox plugin.
Is there no way that I can utilize chronoforms to save to web storage?
GreyHead 14 Apr, 2016
Hi Penny,

You usually need to load the form in a iFrame in the modal window to make sure that the validation files are accessible there.

You can save from ChronoForms to a web service if you need to, but not without saving the form*.

Bob

*You probably could using Ajax to submit each input onChange but that's not typical.
penny 14 Apr, 2016
1 Likes
Bob
Success!!
I have created a script
<script type="text/javascript">
jQuery(document).ready(function () {
function init() {
if (localStorage["name"]) {
jQuery('#name').val(localStorage["name"]);
}
if (localStorage["cname"]) {
jQuery('#cname').val(localStorage["cname"]);
}
if (localStorage["email"]) {
jQuery('#email').val(localStorage["email"]);
}
if (localStorage["message"]) {
jQuery('#message').val(localStorage["message"]);
}
}
init();
});

jQuery('.stored').keyup(function () {
localStorage[jQuery(this).attr('name')] = jQuery(this).val();
});

jQuery('#localStorageTest').submit(function() {
localStorage.clear();
});
</script>

And added it to the custom code -> when I fill out the form and click off the shadow box and reopen the form my information is saved. I was more concerned about users filling out the form on a mobile device, when you go to scroll sometimes you click off and the form disappears. There is a few more tweeks to it, but this is a start.
GreyHead 14 Apr, 2016
Hi Penny,

Well done :-)

Please let us know how you get on with this.

Bob
This topic is locked and no more replies can be posted.