How to connect a button to html buttons

Hi, my problem is that I’m creating an app that uses chatgpt’s api, I have a button that generates an answer based off your prompt. I’m using a normal button, but I wanted to have 4 options that will help give context to chatgpt. I’m using HTML to create these buttons, so when you click on it just highlights. Now the problem is that I really don’t know how to connect these buttons to bubble at all. And I also don’t know how I could make these buttons tell chat gpt “hey give your response in this context” If anyone could help that’d be great.

You should use Toolbox Plugin | Bubble plugin to send data from your HTML button to Bubble. Specifically, you have to use Javascript to Bubble element. See the demo below that gets the input’s value inside a button in HTML and send it back to an alert:
chrome_2CSox9KpHq

Simply, this element produces a function available to trigger an event in Bubble:

After setting these, you have a function that you can call in any HTML element. See how I call the function bubble_fn_try with some parameter (the value of the input box):
image

The first checkbox Trigger event mean they would trigger a workflow in Bubble:
image

The second checkbox Publish value is to receive parameters. This is how I showed the value in an alert for example:
image

Of course, you should also set the Value type to text (or whatever type you need) so it will not give errors when you are getting the value. Otherwise, you will get this error:

For the full example, check this editor: Tests for Forum 10 | Bubble Editor

This topic was automatically closed after 70 days. New replies are no longer allowed.