Forum Discussion

RhettMelton's avatar
RhettMelton
Qrew Trainee
7 years ago

Utilizing HTML/CSS pages in JS using IOL

Good day everyone, 

As a challenge, I've been provided by my company a standalone 'app' within QuickBase that has two tables ('States' table is the parent of 'Exchanges' table, as one state contains many exchanges), and the task at hand is to use JavaScript to create a column with buttons on the States table that:

  • Generates a pop-up form
  • The form should take in two pieces of info: Approval/Denial status and a Comment String
  •  That info is then used to make Quickbase API calls to update every exchange record for a given state 

Pretty straightforward, right? 

My issue is that I can't seem to get my JavaScript to communicate with my custom HTML/CSS code pages, so I can't get the pop-up window open. (Alerts, yes. Modals, no.)

Typically, one starts with HTML and connects the JS via <script src=""></script> and the CSS via <link type="text/css" rel="stylesheet" href="">.  Launch the HTML page, utilize the DOM in JS, and there's no issue. 

With QuickBase, I'm using the IOL technique, so my button is accessing JS first.  How do I get my JS code page to interact with my HTML/CSS code pages? Is there a trick with the 'document' object that I'm missing? 




----

myButton variable: 

<a href="javascript:void();" class="trinity-custom-button Vibrant" minwidth="Auto" maxwidth="Auto" fontsize="12" onclick ="generatePopUp(); return false;">Approval Review</a>

<img src='/i/clear2x2.gif' onload="javascript:if(typeof QBU=='undefined'){QBU={};$.getScript(gReqAppDBID+'?a=dbpage&pagename=module.js&rand='+new Date().getTime())};">
Appears like this, and can call functions from within my code page module.js:


    • RhettMelton's avatar
      RhettMelton
      Qrew Trainee
      Thanks for the quick response!
      I'm specifically being asked to provide a solution using JavaScript (even though there may be native solutions).