Submit start process

Hi,
I have a start process and I want to submit it directly. Via javascript or whatever.

I tried unsing an empty form

<form role="form" name="emptyForm">
     <script cam-script type="text/form-script">
        camForm.on('form-loaded', function() {

        });
    </script>
</form>

All I want to do is call the submit button of the dialog where my form is embedded. Is this somehow possible?

Hi Armin,

Based on your requirements there is no need for a start form
& I think to do it the best way
Your start event should be modeled with no form specified.
That way a generic form will be displayed where you don’t need such a form (you only need to start the process as I understood)
To prevent the generic form from rendering in your case you need to extend the start process plugin

Hi Hassan,
that is exactly my requirement. But I don’t want to extend the start process plugin for just clicking a button.
I was thinking more of a form.xxx.submit() or sth.

Hi Armin,

The camForm variable is an instance of the CamSDK.Form class and is the primary access point to the form api

And I guess you can call

camForm.submit(function (err) {
// do something with the (or, hopefully, the lack of) error
});

From inside

camForm.on(‘form-loaded’, function() {

});

I found this one:

<form role="form" name="emptyForm">
     <script cam-script type="text/form-script">
        camForm.on('form-loaded', function() {
            $scope.complete();
        });
    </script>
</form>

This works perfectly. But the start form appears and it takes 2 to 3 secs until the start form disappears. Is there a way to improve performance?

Finally I went with

<form role="form" name="emptyForm">
     <script cam-script type="text/form-script">
        $scope.complete();
    </script>
</form>
2 Likes

Hi,

my requirement is to add box with yes and no button on submit of form. when the box appears then evt.submitPrevented = true; and on click of yes button evt.submitPrevented = false;
$scope.complete();

but $scope.complete(); is not working for me. I tried camForm.submit() also but no luck. Please help.

camForm.on(‘submit’, function(evt) {

      document.getElementById('confirmBox').style.display="block";
      document.getElementById('message').innerHTML='Test';
      evt.submitPrevented = true;

      document.getElementById('ok').onclick = function(){           	  
          evt.submitPrevented = false;
          $scope.complete();
         document.getElementById('confirmBox').style.display="none";
}

      document.getElementById('cancel').onclick = function(){
        evt.submitPrevented = false;
        document.getElementById('confirmBox').style.display="none";
  }
});