ricslabb03
Member
I have created a button that will set a flag element if the form doesn't have an id and then submit the form to get an id. However, I need to prevent the page from reloading after the submit as I will be reloading it later.
I looked at some of the examples in http://fabrikar.com/forums/index.php?wiki/form-javascript-objects/
However I didn't find anything on preventing the refresh. This is my code:
It runs without errors (I used dev tools), but (I think that) form.result = false is incorrect as it doesn't submit the form's values.
Is there a function I can call to prevent the refresh?
Richard
I looked at some of the examples in http://fabrikar.com/forums/index.php?wiki/form-javascript-objects/
However I didn't find anything on preventing the refresh. This is my code:
JavaScript:
requirejs(['fab/fabrik'], function () {
Fabrik.addEvent('fabrik.form.submit.end', function (form) {
var elements = form.formElements;
var flag = elements.get('video_investigations___no_id').get('value');
if (flag === "1")
{
form.result = false;
}
});
});
It runs without errors (I used dev tools), but (I think that) form.result = false is incorrect as it doesn't submit the form's values.
Is there a function I can call to prevent the refresh?
Richard