Forum Discussion

AmberPolston's avatar
AmberPolston
Qrew Cadet
6 years ago

HTML or JavaScript?

So I am new to this whole HTML/javascript world. 

I have a button on my RFQ table "Respond to RFQ". 

This button is a formula rich text:
"<a href=\"https://louisberger.quickbase.com/db/bpa6iqgxh?a=dbpage&pageID=13\"><img src=\"https://dabuttonfactory.com/button.png?t=Respond+To+RFQ&f=Bellota-Bold&ts=24&tc=fff&tshs=1&tshc=000&hp=20&vp=8&c=round&bgt=unicolored&bgc=7e7f34\"></a>"

This button works perfectly fine.  My question is - Is there a way to include fields in this button formula that can autofill in some of my data fields on my HTML form??

For Example:
FID 121 (Unique RFQ Code) would go into the RFQ Code box on my HTML page.
FID 130 (Related Vendor) would go into the Company Name field on my HTML page.

------------------------------
Amber Polston
------------------------------
  • Amber,

    It looks like your button is taking the user to a page and not editing or creating a record that is the response to the Request for Quote.  Depending on the architecture of the application it could look like this.  I am assuming this table structure

    RFQ << REQResponse

    // Images

    // URL HTTP GenAdd

    var text RFQURL =
      URLRoot() & "db/" & [_RFQResponse] &
      "?a=API_GenAddRecordForm&_fid_8=" & URLEncode ([Record ID#])&
      "&_fid_121"& URLEncode([Unique Code])&
      "&_fid_130"& URLEncode([Related Vendor])&
      "&z=" & Rurl(); 
     
    // Respond to RFQ

     "<a href=" & $RFQURL & "' title=\"Respond\">"  & $$ButtonIMG &  "</a>"


    This would add a child record to the RFQ and pre fill fields  121 and 130.  It assumes that the Related Vendor and the Unique Code are fields in the record where the button is pushed.  It also assumes the FID 8 will set the relationship between the RFQ and the response.

    Don

    ------------------------------
    Don Larson
    Paasporter
    Westlake OH
    ------------------------------
    • EvanWestbrook's avatar
      EvanWestbrook
      Qrew Cadet
      Amber, 

      As Babi mentions, Don's response should get you started on your button. If you're interested in learning more about how to make rich text buttons, here are a few tips and resources:

      • Magic Buttons on the App Exchange has many great examples for future reference
      • On a high level, a Rich Text button is just an HTML anchor element formatted to look like a button. If you think about it that way, it's a little easier to digest.
        • The "href" attribute will almost always be a QuickBase API call using the URL alternative (and you can use any of them.) In case you're not familiar, an API call is like an advanced version of QuickBase's formula functions.
          • You can read about the available API calls here
        • You can read about HTML anchor elements here
          • Anchor elements can be formatted using inline styling (read more here) using most CSS properties available to the Button element.
      • Make sure to use the URLEncode() function around any fields that are not number or text, have spaces, or have special characters.

      Once you get comfortable with HTML in Rich Text fields, the world is yours regarding most standard HTML elements. We've had success embedding <table> elements containing multiple different <a> buttons. Some users have even added <iframe> elements!

      ------------------------------
      Evan Westbrook
      PRIME Developer
      Harder Mechanical Contractors Inc.
      Portland OR
      ------------------------------
  • BabiPanjikar's avatar
    BabiPanjikar
    Qrew Assistant Captain
    It looks Don's response should get you what you need.

    ------------------------------
    Babi Panjikar
    ------------------------------