ppbb123 Posted May 24, 2012 Report Share Posted May 24, 2012 I would like to use cascade dropboxs in a submission form, but I wants the child box to be a text field. The user could edit it. Thanks Quote Link to comment Share on other sites More sharing options...
0 HongTaiLang Posted May 24, 2012 Report Share Posted May 24, 2012 1. create a virtual field as text type, 2. hide the child dropbox by surrounding it with HTML table tags: http://howto.caspio.com/customization/h ... pages.html 3. insert the following code into the footer <script> function drop(){ document.getElementById('cbParamVirtual1').value = document.getElementsByName('InsertRecordFieldName')[0].value; } document.getElementsByName('InsertRecordFieldName')[0].onchange = drop; </script> cbParamVirtual1 is element id of the virtual field. InsertRecordFieldName is element id of the child dropdown. Quote Link to comment Share on other sites More sharing options...
0 fangjie Posted August 7, 2012 Report Share Posted August 7, 2012 Caspio cascading dropdowns always ask to verify in the Details/Update page. It will populate the old value in the table instead of the real related value from parent dropdown at first. If you only have one related value, and want to select the related value automatically. Here is the solution: 1. Create a Virtual field (id might be "cbParamVirtual1") as a cascading dropdown to receive the value, change the second cascading dropdown (id might be "EditRecordFieldName") to a Text field. 2. Insert the following code to pass the value from Virtual field to Text field. <script> function drop(){ document.getElementById('EditRecordFieldName').value = document.getElementsByName('cbParamVirtual1')[0].value; } document.getElementById("caspioform").onsubmit=drop; </script> 3. Hide the fields if it is needed. Quote Link to comment Share on other sites More sharing options...
0 HongTaiLang Posted September 5, 2012 Report Share Posted September 5, 2012 document.getElementById('cbParamVirtual1').value = document.getElementsByName('InsertRecordFieldName')[0].options[0].innerHTML; Quote Link to comment Share on other sites More sharing options...
Question
ppbb123
I would like to use cascade dropboxs in a submission form, but I wants the child box to be a text field. The user could edit it.
Thanks
Link to comment
Share on other sites
3 answers to this question
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.