Jump to content
  • 0

Cascading Form Elements


ppbb123

Question

3 answers to this question

Recommended Posts

  • 0

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.

Link to comment
Share on other sites

  • 0

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.
Link to comment
Share on other sites

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.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...