> For the complete documentation index, see [llms.txt](https://docs.launchboard.app/cxd/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.launchboard.app/cxd/code-chatbot-1/code-mods/use-buttons-for-user-input.md).

# Add Buttons for User Input

![](https://1983969920-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LDyoCvEvghs7p1-AnQM%2F-LLo_97IzRPFz0vjuEdu%2F-LLoc28z5nAbagNJR99J%2FbuttonScreenShot.png?alt=media\&token=a06dede0-3edb-466c-8720-d35e88507ffb)

While a text interface is great for allowing people to engage with natural language, there are times when a simple button has advantages allowing you to interact with specificity and save time for the user.&#x20;

### Use HTML Buttons Directly in the Rivescript

Below is an example of how you could insert buttons in the chatbot's response. It uses a standard HTML button element with an `onclick` attribute to run the  \`getReply() function of the chatbot library. Notice how each argument in the `getReply` functions ('hello', 'bye', or 'youre awesome') is a string that will match a trigger in your Rivescript file.

{% hint style="info" %}
Notice that the example below uses the continuation syntax (`^`) in the chatbot response to make the Rivescript easier to read. Also notice that the optional  `<br>` element is used to create a line break in the chatbot interface.
{% endhint %}

{% code title="Rivescript" %}

```javascript
+ start
- What would you like to say?<br> 
^ <button onclick="chatbot.getReply('hello')">Hello</button><br>
^ <button onclick="chatbot.getReply('bye')">Bye</button><br>
^ <button onclick="chatbot.getReply('youre awesome')">You are Awesome</button>

+ hello
- Hi.

+ bye
- Bye. Come back soon.

+ youre awesome
- Thanks. You are even more awesome.
```

{% endcode %}

That's it. Modify as needed.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.launchboard.app/cxd/code-chatbot-1/code-mods/use-buttons-for-user-input.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
