jayandang Posted July 28, 2009 Report Share Posted July 28, 2009 I have a field named "CombinedField" which combines the values of two fields using Javascript. Caspio's platform forces me to show this field on my webform (I don't have the option to hide this field using their wizard). However, I need this field to be hidden (work in the background). So, I'm thinking I need to use Javascript to hide this field. I've tried two different javascript codes (see below), but neither seem to work. document.getElementById("CombinedField").style.display =†noneâ€; document.forms.caspioform.CombinedField.style.visibility='hidden'; Can someone please tell me what I'm doing wrong? I'm assuming this is fairly simple, but I can't get this to work. Thanks in advance! Quote Link to comment Share on other sites More sharing options...
MeghaJ Posted July 29, 2009 Report Share Posted July 29, 2009 Hi, I agree JavaScript requires some playing around..So keep trying It is essentially Event based. Put in simple words, you can say JavaScript works like: If "This Action" happens, Give "This Reaction". In your script you have the "This Reaction" but you are not specifying that the JS compiler needs to give this Reaction on which Action. So change your code as: window.onload =document.getElementById("CombinedField").style.display ='none'; Hope this helps. Thanks Megha Quote Link to comment Share on other sites More sharing options...
jayandang Posted July 29, 2009 Author Report Share Posted July 29, 2009 I cut and pasted your solution, but it still isn't working. So, I surfed the web some more and tried to the following code (see below) and it also isn't working. I can't believe that hiding a field is this complicated. Do you have any other suggestions? Also, should the code (once it's corrected) be placed in the header or footer portion of my datapage? Thanks again for your help. function load() { document.getElementById("CombinedField").style.display ='none'; } document.getElementById("caspioform").window.onload=load; Quote Link to comment Share on other sites More sharing options...
anonymous3009 Posted July 29, 2009 Report Share Posted July 29, 2009 Hi, Yes, add the code in either the footer or header - it should work. The code looks fine to me. Thanks - SO Quote Link to comment Share on other sites More sharing options...
cheonsa Posted December 30, 2018 Report Share Posted December 30, 2018 Hi @jayandang, Another way to hide the field on your form is to set the form element to "Hidden" or surround it using HTML table tags and setting the table’s display style to “none”. For more information, you can check this howto document: https://howto.caspio.com/tech-tips-and-articles/common-customizations/how-to-hide-fields-in-datapages/ Regards, kristina 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.