Hi!
Is it possible activate an action when loading a page with form, without submit
I try with this javascript but doesnt work
document.forms[0].submit();
alert("enviado");
Maybe I didn't make myself clear. I need to activate the send form action when the page loads without having to click on the send button
Hello and thank you for contacting the Toolset support.
What you are, probably, looking for is the submit function in jQuery. hidden link
If you have only one form inside the page you can use the following code:
// Passing our function to jQuery will execute it when the page loads
jQuery(function(){
// submit the form
jQuery('form').submit()
})
If you may have multiple forms on the page, you will need to scope the jQuery selector. For example, put the form inside a <div> that has the class "my-form" and use the following code:
// Passing our function to jQuery will execute it when the page loads
jQuery(function(){
// submit the form
jQuery('.my-form form').submit()
})
I hope this helps. Let me know if you have any questions.
Thanks Jamal,
Where do I have to put that code? if I put it in the post-form it doesn't work.
Do I have to put it on the page? How do I add a js on the page?
You can add it to the Javascript section(JS editor) of the form, check this screenshot hidden link
Thanks Jamal.
I added there but doesnt work it.
I'll need to take a closer look at your form and where it is being used to understand why it is not working. If you would agree, your next reply will be private to let you share credentials safely. ** Make a database backup before sharing credentials. **
My issue is resolved now. Thank you!