Add Javascript to a button

  • 0
  • 1
  • Question
  • Updated 2 years ago
  • Acknowledged
Original Post:
  • Asked by Ralph
  • a month ago
I know VERY little about the frontend and how it works, I usually work on the backend API side. I would like to know if there was a way to add a button to a form and have it call some javascript which would make an ajax call to an outside webservice.

Thanks

Ralph

Photo of Dan G. (QB Support)

Dan G. (QB Support), Official Rep

  • 490 Points 250 badge 2x thumb

Posted 2 years ago

  • 0
  • 1
Photo of Dan G. (QB Support)

Dan G. (QB Support), Official Rep

  • 490 Points 250 badge 2x thumb
Answer

Your question involves two different issues:

1) How to launch script from a button?

2) Can your API be called client side from QuickBase?

To answer the first question see the attached pdf named "Button Study" which demonstrates six different ways to attach a script to a button. Since you are new to frontend you may want to just use the first method as the remaining methods deal with more advanced schemes.

To answer the second question your API needs to support CORS (Cross Origin Resource Sharing) or return JSONP (JSON with Padding). It would help if you could identify the API and point to the docs.



Was this answer helpful?

Answered by:
Original
dandiebolt_QB_Pirate , Pres. of Service Worker Union
QuickBase Pro a month ago