Jump to content

Recommended Posts

Hello,

I have been using the following code in the footer of a details data page. It previously worked to concatenate an autocompleted value from a virtual field with a text area field called "associatedSpecies." This is based on the javascript solution from Caspio below, but I'm not sure if this is no longer supported by more recent browsers? Does anyone have any insight on how I might make this work again?

<SCRIPT LANGUAGE="JavaScript">
function concatenate()
{
var x0 = document.getElementsByName("EditRecordassociatedSpecies")[0].value;
var x1 = document.getElementsByName("cbParamVirtual2")[0].value;

if (x0 && x1) {
 document.getElementsByName("EditRecordassociatedSpecies")[0].value = x0+"; "+x1;
} else { 
 document.getElementsByName("EditRecordassociatedSpecies")[0].value = x0 + x1;
} 

}

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

 

Link to post
Share on other sites

Hi @Heineperson

Caspio has stopped supporting onsubmit code:  https://howto.caspio.com/release-notes/caspio-bridge-13-0/13-0-impacted-areas/

Please try the following fix:

<SCRIPT LANGUAGE="JavaScript">
document.addEventListener('BeforeFormSubmit', function (event) {
var x0 = document.getElementsByName("EditRecordassociatedSpecies")[0].value;
var x1 = document.getElementsByName("cbParamVirtual2")[0].value;

if (x0 && x1) {
 document.getElementsByName("EditRecordassociatedSpecies")[0].value = x0+"; "+x1;
} else { 
 document.getElementsByName("EditRecordassociatedSpecies")[0].value = x0 + x1;
} 
});
</SCRIPT>
Link to post
Share on other sites
  • 5 months later...

Hi @Heineperson,

 

I hope you could still find this useful. But, just to give you an update, you can do concatenation without using JavaScript. 

You can use Calculated Value in your form. You may check this link for reference: https://howto.caspio.com/datapages/datapage-components/calculated-values/

 

Regards,

kristina

Link to post
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...