sg1234567 Posted November 13, 2009 Report Share Posted November 13, 2009 I am not a programmer so I will need some help with what I am trying to achieve. Caspio currently does cacading relationships for listbox and dropdowns… But what I am interested in is: Let’s say I have a parent field which is a drop-down menu style, I would like this to be connected to its child field (which will be a text box). So when the parent field is activated… the child text field becomes activated so text can be typed into it. If not then it stays grayed out or disabled. Hypothetical example: Parent (Dropdown): Do you have children? (Dropdown/Checkbox saying: Yes/No) Child (Textbox): How many? (text box) – this should become activated only if the user selects Yes in the parent field. Sample code I have written so far: var Selection=document.getElementByld("InsertRecordSelection"); var Value=document.getElementByld("InsertRecordValue"); function fun_conditional() if (Selection.checked){ Value.style.display=''; } else { Value.style.display='none'; } Selection.onclick=fun_conditional; When I cut and paste the above code into the footer section of my datapage, it does not work. Any suggestions or ideas please help. Do I have to add any other code into this to make it work? Thank you in advance for your help. Regards. Quote Link to comment Share on other sites More sharing options...
anonymous3009 Posted November 16, 2009 Report Share Posted November 16, 2009 Hello, You could write something like the following: Setting up the child value with a div to hide by default ============================================= Insert an HTML block right above the child field and insert the following ============================================= Insert an HTML block right below the child field and insert the following ============================================== JavaScript to Hide/Display child based on selection value - inserted in footer ============================================================ var selection=document.getElementById("InsertRecordSelection"); var value=document.getElementById("cb_child"); function show() { if (selection.checked) { if (selection.value == 1) { value.style.display="block"; } } else { value.style.display="none"; } } selection.onclick = show; Hope this helps. Best, -SO Quote Link to comment Share on other sites More sharing options...
Kurumi Posted February 6, 2020 Report Share Posted February 6, 2020 Just an update: You could try to check the Conditional Forms to disable the field: 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.