Heineperson Posted January 23, 2019 Report Share Posted January 23, 2019 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> Quote Link to comment Share on other sites More sharing options...
BaySunshine Posted January 26, 2019 Report Share Posted January 26, 2019 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> Heineperson and Harbinger 1 1 Quote Link to comment Share on other sites More sharing options...
Heineperson Posted January 29, 2019 Author Report Share Posted January 29, 2019 @BaySunshine - Thank you so much! This worked perfectly!!! Quote Link to comment Share on other sites More sharing options...
cheonsa Posted July 7, 2019 Report Share Posted July 7, 2019 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 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.