Jump to content

Is it possible to have javascript to get data from a virtual field which has the form element cascading text field


Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 3 years later...

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>

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