Jump to content
  • 1

Automatic Field Update


Elena

Question

Hello,

 

In my Report Details,  I have this field, "New_Job_Grade" that takes value from calculated field, [@calcfield:44#].

 

I am using the script below which I copied from somewhere else here in the forum. It sure works wonderfully.

 

However, I would like for the field "New_Job_Grade" to be automatically updated and not wait for the form to be submitted everytime "[@calcfield:44#]" is changed.

 

Is there a way to amend the ".onsubmit=concatenate" to automatically update the form and not having the need to push any button?

 

Thank you in advance. Below is the script.

 

 

 

<SCRIPT LANGUAGE="JavaScript">

function concatenate()
{
var x = document.getElementsByName("[@calcfield:44#]")[0].value;

document.getElementById("InsertRecordNew_Job_Grade").value = x;

}

document.getElementById("caspioform").onsubmit=concatenate;
</SCRIPT>

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hello Elena!

 

You can try to activate your function when changes were made in the Calculation Field. For this try to change the last line of the script (.onsubmit->.onchange, so it will we as follows:

<SCRIPT LANGUAGE="JavaScript">

function concatenate()
{
var x = document.getElementsByName("[@calcfield:44#]")[0].value;

document.getElementById("InsertRecordNew_Job_Grade").value = x;

}

document.getElementById("caspioform").onchange=concatenate;
</SCRIPT>

i hope this helps.

 

Have a nice day 

 

Aurora  :)

Link to comment
Share on other sites

  • 0

Hi All, 

Just to give an update, we now have a new feature called Calculated Value in Caspio Bridge. The Calculated Value form element generates dynamic calculations that automatically update as users interact with your form.  You may check this link for more information: https://howto.caspio.com/datapages/datapage-components/calculated-values/

 

-kristina

Link to comment
Share on other sites

  • 0

Hi - Just wanted to share this solution. You can use this if you have a Tabular Report with Inline Edit and upon update, you want to reload the whole page. Insert it in the Footer of the DataPage.

<script type="text/javascript">

document.addEventListener('DataPageReady', function (event) {

  document.addEventListener("change", function(event){

    var edit= document.querySelector('[name="Mod0InlineEdit"]');
    
       edit.addEventListener("click", function(){
          window.parent.location = document.referrer;
       });
  });
  
});
</script>
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.

Guest
Answer this question...

×   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...