Jonathan Posted June 13, 2016 Report Share Posted June 13, 2016 Hi, While being fairly new to javascript. I was wondering if it is possible to do a calculation with a Virtual field which is set up as cascading text field to look up information from a different table. I cannot get it to work while when using a regular text field and the data is put in manually it works. Quote Link to comment Share on other sites More sharing options...
GoCubbies Posted June 14, 2016 Report Share Posted June 14, 2016 Hello Jonathan, Try something like this: var x = document.getElementsByName("cbParamVirtual1")[0].value; You may want to take a look at the post on Caspio Form Elements for more references as well. LWSChad 1 Quote Link to comment Share on other sites More sharing options...
MayMusic Posted June 14, 2016 Report Share Posted June 14, 2016 You can try <script> document.getElementById("caspioform").onsubmit = function(){ document.getElementById("cbParamVirtual1"). value = document.getElementsByName("cascading form element NAME")[0].value; } </script> You need to get the cascading element NAME not the ID (Since cascading ID changes on each page load) and place it there. Quote Link to comment Share on other sites More sharing options...
Jonathan Posted June 16, 2016 Author Report Share Posted June 16, 2016 thanks for all the help. In the end I got rid of the virtual field and used: var test = parseFloat(document.getElementsByName("InsertRecordADR_2015")[0].value); Quote Link to comment Share on other sites More sharing options...
MayMusic Posted June 17, 2016 Report Share Posted June 17, 2016 Yes if you do not want to shoe the value in the page and only to use it in your code you can create a variable Quote Link to comment Share on other sites More sharing options...
MikeDDDD Posted January 24, 2020 Report Share Posted January 24, 2020 I would like to do the opposite but am running into issues. I want to use javascript to set the value of a Virtual field to the referring domain. I am using the following code in the footer of a datapage. Does anyone know what I am doing wrong? <script type="text/javascript"> document.addEventListener('DataPageReady', function (event) { var initreferrer = document.referrer; document.getElementById("cbParamVirtual7").value = initreferrer; }); </script> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.