PxDeininger Posted June 19, 2017 Report Share Posted June 19, 2017 I have a form where users can add multiple line items to be researched. I've been asked to create field that lists all the items to view in a report. I put this in my form on Friday and it was working fine but when we were testing today, the fields are not working anymore. <SCRIPT LANGUAGE="JavaScript"> function con1() { var v1 = document.getElementById("EditRecordItem1").value; var v2 = document.getElementById("EditRecordItem2").value; var v3 = document.getElementById("EditRecordItem3").value; var v4 = document.getElementById("EditRecordItem4").value; var v5 = document.getElementById("EditRecordItem5").value; var v6 = document.getElementById("EditRecordItem6").value; var v7 = document.getElementById("EditRecordItem7").value; if (v1 !="" && v2 == "" && v3 =="" && v4 =="" && v5=="" && v6=="" && v7=="") { document.getElementById("EditRecordF14").value = v1; } if (v1 !="" && v2 != "" && v3 =="" && v4 =="" && v5=="" && v6=="" && v7=="") { document.getElementById("EditRecordF14").value = v1 + ", " + v2; } if (v1 !="" && v2 != "" && v3 !="" && v4 =="" && v5=="" && v6=="" && v7=="") { document.getElementById("EditRecordF14").value = v1 + ", " + v2 + ", " + v3; } if (v1 !="" && v2 != "" && v3 !="" && v4 !="" && v5=="" && v6=="" && v7=="") { document.getElementById("EditRecordF14").value = v1 + ", " + v2 + ", " + v3 + ", " + v4; } if (v1 !="" && v2 != "" && v3 !="" && v4 !="" && v5!="" && v6=="" && v7=="") { document.getElementById("EditRecordF14").value = v1 + ", " + v2 + ", " + v3 + ", " + v4 + ", " + v5; } if (v1 !="" && v2 != "" && v3 !="" && v4 !="" && v5!="" && v6!="" && v7=="") { document.getElementById("EditRecordF14").value = v1 + ", " + v2 + ", " + v3 + ", " + v4 + ", " + v5 + ", " + v6; } if (v1 !="" && v2 != "" && v3 !="" && v4 !="" && v5!="" && v6!="" && v7!="") { document.getElementById("EditRecordF14").value = v1 + ", " + v2 + ", " + v3 + ", " + v4 + ", " + v5 + ", " + v6 + ", " + v7; } } document.getElementById("caspioform").onchange=con1; </SCRIPT> Quote Link to comment Share on other sites More sharing options...
MayMusic Posted July 3, 2017 Report Share Posted July 3, 2017 For item1 to 7 make sure you are having static ID for instance if any of them are cascading element the ID will follow with some numbers which is different on each load. To check you can right click on the element in your browser and select Inspect Element. If the ID has some extra numbers after it you need to refer it by name instead in this format: var v1 = document.getElementsByName("EditRecordItem1")[0].value; To see what error you are receiving, open the page in browser, click f12 to open developer tool and select console tab, reload the page and see what error message you are getting. Quote Link to comment Share on other sites More sharing options...
Meekeee Posted August 23, 2021 Report Share Posted August 23, 2021 Hi! Just an update, you may now use Calculated Value on this. See this link for more information. 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.