Page 1 of 1

saveForm() function not working

Posted: Sun Jul 11, 2021 11:42 am
by rparvez700
I have a textbox which is filled via javascript on page load. i also have a button which triggers saveForm() function. But the text field is not getting saved. but if I type manually something on keyboard it gets saved. any workaround?

Re: saveForm() function not working

Posted: Sun Jul 11, 2021 8:27 pm
by kirkwg
Hello there,

Better to provide the related Javascript code for troubleshooting. Thanks.

Re: saveForm() function not working

Posted: Sun Jul 11, 2021 9:29 pm
by rparvez700
Here is the javascript code.
Code: Select all
$("#button0000000001").find("button").on("click" , function(event) {
    $("#3064270015f79d4728e9440079016900").saveForm();
    alert("Data is saved but not submitted to next task");
} );
This code saves all the input given manually but not the ones I fill with javascript when the page loads.
I am using 3.1.3 community of Processmaker.

Re: saveForm() function not working

Posted: Sun Jul 11, 2021 11:31 pm
by kirkwg
This click function looks fine, thanks.

(also make sure the form id is correct? - $("#3064270015f79d4728e9440079016900").saveForm();
Otherwise use $("form").saveForm(); if you got only 1 form in the Dynaform.

Can you also show me the code how you fill in the field when the form after loading? If still not saving, you can use PHP Trigger to fill in the field before dynaform?

Re: saveForm() function not working

Posted: Tue Jul 13, 2021 1:21 am
by programerboy
Hi,
How to set the textbox field with JavaScript, keep in mind that you must use the setValue function, otherwise the set will not work properly.

https://pmlearning.info
Thanks

Re: saveForm() function not working

Posted: Sun Jan 02, 2022 6:24 am
by ljglmail
You can save your form data with the saveForm() function. This function is designed to help you submit and store data in a specified location on the user's computer. There are two ways to use this function. The first method requires that you specify a file name when you call the saveForm() function, while the second method allows you to specify a filename and path later in the process.

Re: saveForm() function not working

Posted: Mon Mar 07, 2022 11:39 am
by chieunh
rparvez700 wrote: Sun Jul 11, 2021 9:29 pm Here is the javascript code.
Code: Select all
$("#button0000000001").find("button").on("click" , function(event) {
    $("#3064270015f79d4728e9440079016900").saveForm();
    alert("Data is saved but not submitted to next task");
} );
This code saves all the input given manually but not the ones I fill with javascript when the page loads.
I am using 3.1.3 community of Processmaker.
Try:
Code: Select all
$("#btnSave").on("click", function() {
    $(`#${frames.dyn_uid}`).showFormModal();
    $(`#${frames.dyn_uid}`).saveForm();
    $(`#${frames.dyn_uid}`).hideFormModal();
});