Login to follow this  
Followers 0
dbromfield

How To Automate Submit Form With .js While Filling Field

5 posts in this topic

I received wonderful assistance yesterday from the community with  filling a caspio form field with value calculated by javascript routine in the footer of the submission form.  It works beautifully!!

 

I would like  to automatically submit the form after filling the field & so get rid of the 'submit' button.  Any help is greatly appreciated.

 

The current fill form routine that works well is below:

 

<SCRIPT LANGUAGE="JavaScript">
function Fill_field()
{
document.getElementById("InsertRecordPeriod").value = (pperiod);
}
 
/* On submitting the webform, the function Fill_field is executed */
 
document.getElementById("caspioform").onsubmit=Fill_field;
 
</SCRIPT>

Share this post


Link to post
Share on other sites

There is an auto submit code which you can use in your code at http://forums.caspio.com/index.php/topic/4314-js-auto-submit-a-datapage/

 

You need to call your function before submitting the page and then auto-submit in the function. For instance

<SCRIPT LANGUAGE="JavaScript">

function Fill_field()
{
document.getElementById("InsertRecordPeriod").value = (pperiod);
setTimeout('document.forms["caspioform"].submit()',1000);
}

/* On submitting the webform, the function Fill_field is executed */

Fill_field();

</SCRIPT>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Login to follow this  
Followers 0