Solved

Quickbase API Quuestion. Need to populate 2 drop downs from separate tables

Posted on 2012-04-12
2
646 Views
Last Modified: 2016-11-17
I have a web form which connects to a Quickbase application db.

The db has 2 tables with fields
Table: Region
Field: Region (which is populated)
Table:Site
Field: Site (which is also poplulated)

I need to be able to display the field selections available within QB on the drop down field within the html form field.

I am able to display the Regions field (named _fid_6 within QB)
However I can't figure out how to get the Site field from the Site table to display. Within the Site table it's id is also _fid_6.
0
Comment
Question by:js1138
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 37842322
each time you change the first one, you need to clear the site dropdown and fill it with value where Site._fid_6 = Region._fid_6

generaly we use the onchange attribute :

<select id="RegionDropdown" onchange="updateSiteDropdown([b]this.value[/b]);">

Open in new window


the value of each option is the ID of the Region : _fid_6

you've a javascript function to :

function updateSiteDropdown(_fid_6) {
       var SiteDropdown = document.getElementById("SiteDropdown");

       // clear it the Site Dropdown:
       SiteDropdown.options.length = 0
  
       // getOptionsWithAjaxCall; // http://www.w3schools.com/ajax/ajax_database.asp
       var options = Sites[_fid_6]; // Site is an object like this {    "1":[{v:10,t:"Site11"},{v:11,t:"Site12"},{v:12,t:"Site13"}],  "2":[{v:14,t:"Site2"}]   } where 1, 2 are _fid_6

       var o = new Option;
       var x;
       for(i=0;i<options.length;i++) {
             o.text = options[i].t;
             o.value = options[i].v;
             SiteDropdown.options[SiteDropdown.options.length] = o;
       }
}

Open in new window

0
 

Expert Comment

by:Jess H
ID: 41891981
Thought this may be helpful to others who have questions about the QuickBase API.  QuickBase updated their reference page to include a more detailed guide.  See it here: http://help.quickbase.com/api-guide/index.html
1

Featured Post

Three Considerations for Containers

Containers like Docker and Rocket are getting more popular every day. In my conversations with customers, they consistently ask what containers are and how they can use them in their environment. If you’re as curious as most people, read our article on Experts Exchange.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this series, we will discuss common questions received as a database Solutions Engineer at Percona. In this role, we speak with a wide array of MySQL and MongoDB users responsible for both extremely large and complex environments to smaller singl…
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question