# Using Marketo forms

## Customizing thank you page

The normal Marketo form javascript looks something like this:

```markup
<script>
MktoForms2.loadForm("//app-ab00.marketo.com", "488-XXX-XXXX", 1234);
</script>
```

If you would like to customize the form to route the lead to a custom thank you page, you can modify this javascript. *Note: make sure that you maintain the three existing values from your Marketo form.*

```markup
<script>
MktoForms2.loadForm("//app-ab00.marketo.com", "488-XXX-XXXX", 1234, function(form) {
  form.onSuccess(function(values, followUpUrl) {
    // Take the lead to a different page on successful submit
    location.href = "/your-thank-you-page-url/";
    // Return false to prevent the submission handler continuing with its own processing
    return false;
  });
});
</script>
```

In the above code, you can customize the /your-thank-you-page-url/ and change that to your thank you page.

### Using base\_directory

If the form within your template will be used on multiple sites under different base\_directory paths, you can use our macro to dynamically generate the correct thank you page URL.

```javascript
location.href = "${base_directory}your-thank-you-page-url/";
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.devhub.com/forms/using-marketo-forms.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
