MostlyJava Posted August 4, 2015 Report Share Posted August 4, 2015 Hi there, I have the following code in a submission form: <script> window.onload=function(){ if (document.getElementById("InsertRecordPalmas").checked) {var new_value = "Palmas";} else {var new_value = "AAA";} document.getElementById("cbParamVirtual1").value=new_value; } </script> This code puts a certain value on Virtual1 (which is a TextBox) depending on whether Palmas Check Box is checked or not. It works perfectly, but it stops working when I turn the Submission Form into a Detail Report. I know is not the "onload" because I tested it without the if statement and it works, so I'm guessing it has to do with the way I'm referencing or calling Palmas Check Box. Does anyone knows why is the if statement behaving differently when the Submission Form is changed to a Detail Report? Thanks! Quote Link to comment Share on other sites More sharing options...
Jan Posted August 4, 2015 Report Share Posted August 4, 2015 Hi MostlyJava, As far as I know, the InsertRecord prefix is used on Submission Forms, on Details and Single Update Forms the EditRecord prefis is used. You can change the Id InsertRecordPalmas to EditRecordPalmas. You can find more details about names etc. in a guideline for referencing Caspio form elements using JavaScript. I hope, it helps! sixlevel 1 Quote Link to comment Share on other sites More sharing options...
MostlyJava Posted August 5, 2015 Author Report Share Posted August 5, 2015 That was it, it works perfectly. Thank you very much! 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.