Jump to content

How To Automate Submit Form With .js While Filling Field


Recommended Posts

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>
Link to comment
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>
Link to comment
Share on other sites

  • 9 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...