You are viewing limited content. For full access, please sign in.

Question

Question

Automatic Submit action

asked on February 23, 2015

There is the possibility of operating the "submit" button on a form via the url or javascript?

We realize that we can complete the form fields via the url, but require that the first form is approved automatically without a user to enter and press the button. Any ideas?

1 0

Answer

SELECTED ANSWER
replied on February 25, 2015 Show version history

Hm it works for me.

 

 

https://webapps.rochestermn.gov/Forms/2DNHP

 

What browser/version are you using and if you inspect the submit button element what do you see for the input tag?

<input class="action-btn checkRequired Submit" name="action" value="Submit" type="submit">

 

You could try identifying it by .action-btn instead.

 

$( window).load(function() {
   $(".action-btn").click();
});

Both work on my end in FireFox and IE10.

2 0

Replies

replied on February 25, 2015

You could use jQuery to submit it after the page loads.

 

$( window ).load(function() {
   $("input[type=submit]").click();
});

The user will be flashed with the page but you could test hiding it with css.

 

Once the Forms API is released in the future I think we'll all have more options for this type of behavior.

0 0
replied on February 25, 2015 Show version history

Even with this code, the form asks the user to press submit to send

0 0
SELECTED ANSWER
replied on February 25, 2015 Show version history

Hm it works for me.

 

 

https://webapps.rochestermn.gov/Forms/2DNHP

 

What browser/version are you using and if you inspect the submit button element what do you see for the input tag?

<input class="action-btn checkRequired Submit" name="action" value="Submit" type="submit">

 

You could try identifying it by .action-btn instead.

 

$( window).load(function() {
   $(".action-btn").click();
});

Both work on my end in FireFox and IE10.

2 0
replied on February 26, 2015

Thanks Carl Hunter the code already works

0 0
replied on March 3, 2015

Hi,

So far it works as described

For me needs, I created a Workflow script to open the browser and jump to the URL, the form will be automatically submitted and finally the script closes the browser; by doing this, the end user will receive only a notification email and find the form in his pending task list.

The problem is that the Workflow Script run only on test mode within the Scrip edit page in the workflow designer, but doesn't behave as expected after being published.

My guess is that the script runs on the Workflow server and not the PC with the Workflow Designer, so it might be a permission issue; buy I don know how to address it.

Any ideas?

 

0 0
replied on March 4, 2015

Correct. Any workflow activity, script, or action is taken from the workflow server by the service account configured to operate.

 

Any SDK or script dependencies will have to be installed on the machine used to develop the script and the server machine.

0 0
replied on March 4, 2015

Bernard, as mentioned on David's other thread, it is not possible for a service to launch a web browser and load a URL for a form. It's not a permissions issue, it's the fact that there is no user session for that browser window to live in.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.