Jump to content

Unable To Pass Paramater- Javascript Routine To Caspio Field

Recommended Posts



I have a 'one to many' relational db with Student demographics in the (one) database and classes for each student in the other (many) database.  I have a javascript routine that evaluates the current 'time' and assigns it a Period number (1, 2, etc).  The routine runs fine and outputs its' result in a variable  called 'pperiod' when run.  


I am trying to run this javascript above in the html block of  the submission form  datapage where there is a field named Period assigned  to accept the value in 'pperiod'.


The routine runs fine outside of Caspio, but no value is inserted in my form field when it is run from the html block in the form datapage.


I am at my wits end!  Thanks in advance.

Link to comment
Share on other sites



I would recommend you inserting code in the footer instead of HTML block, also do not assign a value 'pperiod' for the field "Period".


On the event "submit" you should call a function to calculate the value write it in the field "Period".


Take a look at this example. 


I hope this helps.

Thank you very much !!  :)

Link to comment
Share on other sites

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.

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.

  • Create New...