Jump to content

Search the Community

Showing results for tags 'update dropdown'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Caspio Bridge
    • General Questions
    • Caspio JavaScript Solutions
    • Tables, Views and Relationships
    • Import/Export and DataHub
    • DataPages
    • Deployment
    • Security, Authentications, Roles, SAML
    • Styles and Localizations
    • Parameters
    • API and Integration
    • Calculations and aggregations
    • User JavaScript and CSS Discussions

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start




Website URL






Found 1 result

  1. Hello, I'm using some code in the Destination section of a submission datapage, deployed in a popup, to update a dropdown field in another datapage. I can get it to work if the dropdown field is a simple text field (store and display the same field) but am having issues when the dropdown is set to store the Unique ID (integer field) but display a different text field. The purpose of the popup is for the user, when creating an inventory item on one datapage, to be able to add a new 'supplier' for it on the fly in another datapage. When the new 'supplier' is submitted, it's ID value goes to the 'supplier' field dropdown on the original datapage and is added to the available lookup choices. The problem is that this code will put the new Unique ID (the SupplierID) in the the dropdown's 'display' so the user sees the ID number instead of the supplier name they typed in on the popup datapage. That new supplier name (text field) is what I need to 'display' in the drop down field BUT use the uniqueID as the 'stored' value. Also, I normally would use a trigger and a field for quick entry (the Supplier's table is different than the Inventory Items table) that could do all this behind the scenes. However, that table is locked by Caspio because of other backend triggers so I have to do this with datapages. Here's the code I'm using. Again, I need to 'display' the Supplier_Name (text255) value but 'store' the SupplierID (integer) when it's sent to the dropdown in the other datapage. Any help would be really appreciated! <script> window.close(); //Replace the FieldName with the Submission form FieldName(parameter name passed when you checked “on exit”. var element_value='[@InsertRecordSupplierID]' var new_item = window.opener.document.createElement("option"); new_item.text=element_value; new_item.value=element_value; // Add new item to the dropdown try { //Replace the FieldName with the Original DataPage dropdown FieldName window.opener.document.getElementsByName("InsertRecordSupplierID")[0].options.add(new_item, null); } catch(ex) { //Replace the FieldName with the Original DataPage dropdown FieldName window.opener.document.getElementsByName("InsertRecordSupplierID")[0].options.add(new_item); } </script>
  • Create New...