BillyDow Posted February 8, 2018 Report Share Posted February 8, 2018 I have found that if I manually click on a dropdown that is a parent to another cascading dropdown, the cascading dropdown works. But when I try to use javascript to change the value of that parent dropdown, I find that it does not kick off the cascading activity of the cascading dropdown that is connect to it. Strangely, the value changes in the parent dropdown (so it works), but it doesn't impact the cascading dropdown. The js code I am using to change the parent dropdown value is: document.getElementsByName("cbParamVirtual1")[0].value="2012"; which successfully updates the value, so I know the JS works. But it doesn't impact the cascading dropdown. Is there an onchange event that is misfiring? Any suggestions? Quote Link to comment Share on other sites More sharing options...
BaySunshine Posted February 9, 2018 Report Share Posted February 9, 2018 Hello Billy, You can add the following and try: <script> document.getElementsByName("cbParamVirtual1")[0].selectedIndex.text; document.getElementsByName("cbParamVirtual1")[0].value = "2012"; </script> Quote Link to comment Share on other sites More sharing options...
kpcollier Posted November 29, 2018 Report Share Posted November 29, 2018 @BaySunshine Are you still active? I am trying to do something similar. I need to do a cascading feature without doing it through Caspio Wizard. What I need is when a Job is selected from a Dropdown, Order_Number is populated with the Job_Number of selected job. I am guessing something like document.getElementsById("Job")[0].selectedIndex.text; document.getElementsById("Order_Number")[0].value = "Job_Number"; Thanks, KPC Quote Link to comment Share on other sites More sharing options...
BaySunshine Posted December 19, 2018 Report Share Posted December 19, 2018 Hi @kpcollier, You can use a Calculated Value field if this is for a Submission form and write a Select query to fetch the correct value. For example, your select query can look like the following: SELECT JOB_NUMBER FROM TABLE_NAME WHERE JOB=TARGET.[@FIELD:fieldname] fieldname = exact field_name from the current datasource. Similarly include the exact field names for JOB_NUMBER, TABLE_NAME and JOB from the table you are pulling the values from. I hope that helps. Regards, 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.