anibaldps Posted September 6, 2012 Report Share Posted September 6, 2012 Hi: Im having difficulty trying to disable a cascading dropdown field. What code can i use to disable a Cascading Dropdown Field when the page loads? Please help! Anibal Quote Link to comment Share on other sites More sharing options...
MayMusic Posted September 6, 2012 Report Share Posted September 6, 2012 If you have a parent dropdown with a null value, the cascading is disabled till you select a value from the parent. What is the URL of the page? That way I can better understand your question. Quote Link to comment Share on other sites More sharing options...
anibaldps Posted September 6, 2012 Author Report Share Posted September 6, 2012 I understand that the cascading dropdown will appear disabled if there is no value in the parent dropdown. I just need the code to disable the cascading field regardless of what the parent dropdown has. Quote Link to comment Share on other sites More sharing options...
MayMusic Posted September 6, 2012 Report Share Posted September 6, 2012 This will disable the cascading document.getElementsByName("Element Name")[0].disabled= true; but let me see when we should cal it to make this happen :?: :?: :?: :!: :!: :!: Quote Link to comment Share on other sites More sharing options...
MayMusic Posted September 7, 2012 Report Share Posted September 7, 2012 Here is the code :wink: :wink: :wink: var first = true; document.getElementsByName('InsertRecordaddress_Text')[0].onchange = dis; function dis() { if (first) { document.getElementsByName('Element Name')[0].disabled = true; first = false; } else { document.getElementsByName('Element Name')[0].disabled = false; } } You need to insert it in the HTML block, below the cascading dropdown. and also replace Element Name with your valid cascading dropdown field name. I have tried this code in firefox and chrome and it is just working fine. Quote Link to comment Share on other sites More sharing options...
Kurumi Posted June 3, 2019 Report Share Posted June 3, 2019 To disable a specific Form Element, you can now use Rules or Conditional Forms. To know more about it, you can check it here: https://howto.caspio.com/datapages/forms/conditional-forms/ I hope this helps! 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.