Heineperson Posted March 3, 2017 Report Share Posted March 3, 2017 Hi! This is my first question on this forum, so I apologize if this question is not in the scope of the board I followed this thread to concatenate values from four virtual fields onto an existing field on a details page upon "update". I added the code below to the footer of my details page, and it worked when my virtual fields were text fields. However, this code did no longer worked when I changed my virtual fields to autocomplete fields. Is there another step I need to convert the autocomplete to text? <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var x0 = document.getElementById("EditRecordOtherCollectors").value; var x1 = document.getElementById("cbParamVirtual2").value; var x2 = document.getElementById("cbParamVirtual3").value; var x3 = document.getElementById("cbParamVirtual4").value; var x4 = document.getElementById("cbParamVirtual5").value; document.getElementById("EditRecordOtherCollectors").value = x0+" "+x1+" "+x2+" "+x3+" "+x4; } document.getElementById("caspioform").onsubmit=concatenate; </SCRIPT> Thanks! Quote Link to comment Share on other sites More sharing options...
Mathilda Posted March 6, 2017 Report Share Posted March 6, 2017 On 3/3/2017 at 2:51 PM, Heineperson said: Hi! This is my first question on this forum, so I apologize if this question is not in the scope of the board I followed this thread to concatenate values from four virtual fields onto an existing field on a details page upon "update". I added the code below to the footer of my details page, and it worked when my virtual fields were text fields. However, this code did no longer worked when I changed my virtual fields to autocomplete fields. Is there another step I need to convert the autocomplete to text? <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var x0 = document.getElementById("EditRecordOtherCollectors").value; var x1 = document.getElementById("cbParamVirtual2").value; var x2 = document.getElementById("cbParamVirtual3").value; var x3 = document.getElementById("cbParamVirtual4").value; var x4 = document.getElementById("cbParamVirtual5").value; document.getElementById("EditRecordOtherCollectors").value = x0+" "+x1+" "+x2+" "+x3+" "+x4; } document.getElementById("caspioform").onsubmit=concatenate; </SCRIPT> Thanks! Hi, welcome to forum I edited your script a little bit, we need to use another syntax for autocomplete fields. <SCRIPT LANGUAGE="JavaScript"> function concatenate() { var x0 = document.getElementById("EditRecordOtherCollectors").value; var x1 = document.getElementsByName("cbParamVirtual2")[0].value; var x2 = document.getElementsByName("cbParamVirtual3")[0].value; var x3 = document.getElementsByName("cbParamVirtual4")[0].value; var x4 = document.getElementsByName("cbParamVirtual5")[0].value; document.getElementById("EditRecordOtherCollectors").value = x0+" "+x1+" "+x2+" "+x3+" "+x4; } document.getElementById("caspioform").onsubmit=concatenate; </SCRIPT> Quote Link to comment Share on other sites More sharing options...
Heineperson Posted March 8, 2017 Author Report Share Posted March 8, 2017 Thank you so much @Mathilda!!! That worked perfectly! Quote Link to comment Share on other sites More sharing options...
Mathilda Posted March 10, 2017 Report Share Posted March 10, 2017 On 3/8/2017 at 9:04 AM, Heineperson said: Thank you so much @Mathilda!!! That worked perfectly! You're welcome! Glad that it helped 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.