wgalliance Posted August 5, 2016 Report Share Posted August 5, 2016 I am having trouble with this simple if statement. I would like to update a checkbox field if a separate field is "Final Staff Review". The script I have is: <script> function = applocked(){ if (document.getElementById("EditRecordReviews_ReviewStage").value == "Final Staff Review") { document.getElementById('EditRecordApplication_Detail_AppLocked').checked = true;} else { document.getElementById('EditRecordApplication_Detail_AppLocked').checked= false; } } document.getElementById("caspioform").onload = applocked; </script> Am I missing something? The field is a Yes/No field and it is on the datapage as a checkbox field. I also have several formulas deployed on this page, could that be impacting this? This is currently not working. Quote Link to comment Share on other sites More sharing options...
MayMusic Posted August 5, 2016 Report Share Posted August 5, 2016 There should not be equal after function, you should have function applocked() { Also change document.getElementById("caspioform").onload = applocked; to document.getElementById("caspioform").onsubmit= applocked; Quote Link to comment Share on other sites More sharing options...
MayMusic Posted August 9, 2016 Report Share Posted August 9, 2016 @wgalliance Did that work for you? Quote Link to comment Share on other sites More sharing options...
wgalliance Posted August 9, 2016 Author Report Share Posted August 9, 2016 Yes! Thank you for catching such a silly error. I had to change a few other things but this was a simple oversight. 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.