paloo Posted December 20, 2008 Report Share Posted December 20, 2008 Hello. The following javascript works fine, in that it takes an email address ("Email") and copies it to a field ("AckEmail") that is used to populate an acknowledgment email upon the checking of a checkbox ("IssueDeclineEmail") in a record. However, in order for this to work, the Email record needs to be in edit mode (as does the AckEmail field) making it possible for a user to delete the Email value where it will be lost on an Update of that record. Is there anyway to have this javascript work while the field "Email" is hidden or not visible to the user, so there is no possibility of messing it up? Thanks for any help here. <script> function assignemail() { if (document.getElementById ("EditRecordIssueDeclineEmail").checked) { var emailnew=document.getElementById("EditRecordEmail").value; document.getElementById("EditRecordAckEmail").value=emailnew; } else { document.getElementById("EditRecordAckEmail").value="localhost@localhost"; } } document.getElementById ("EditRecordIssueDeclineEmail").onclick=assignemail; </script> Regards, paloo Quote Link to comment Share on other sites More sharing options...
londoncity Posted April 1, 2013 Report Share Posted April 1, 2013 Hello Paloo, You can have the field in a "display only" format so no one is able to edit the email field anymore however you should replace the below line: var emailnew=document.getElementById("EditRecordEmail").value; with var emailnew=[@field:Email]; instead. Hope that helps, londoncity Quote Link to comment Share on other sites More sharing options...
Kurumi Posted June 10, 2019 Report Share Posted June 10, 2019 Hi @paloo, You can also use Conditional Forms to hide a certain field. Check the article here: https://howto.caspio.com/datapages/forms/conditional-forms/ Quote Link to comment Share on other sites More sharing options...
kpcollier Posted June 10, 2019 Report Share Posted June 10, 2019 One problem with this is that if you use the rules to hide the information, it won't work as a parameter and pass information such as the OP wants it to do. If it is hidden with rules, the values just disappear. The issue is similar using Display Only. If someone is using an element or virtual field JUST to access information and pass it to another field like I am trying to do, you need to use that Virtual Field as a cascading autocomplete, meaning you cannot set it to display only. I have a virtual field that is configured as a Cascading Autocomplete. I need to keep this on the submission form because it is essential to one of my other fields, however I don't want it visible on the form. If anyone can help, please let me know! Quote Link to comment Share on other sites More sharing options...
kpcollier Posted June 26, 2019 Report Share Posted June 26, 2019 Just in case anyone is looking for this solution... If using a virtual field, use the following input[name="cbParamVirtual51"] { display: none !important; } Obviously, change the '51' to the number corresponding to the Virtual Field you want to hide. 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.