Use submit button without surrounding form


Using a Sharepoint website, the entire website’s markup is added in one big form.

Meaning that I can’t use the following solution:

Is it possible to use submit button without the form tag, using vanilla JS?


I am having the same issue. The CMS for the site surrounds the page in a form tag and you can’t nest form tags.

Is there an API call that i can use to launch the results modal with the current search value?


This might be the answer you are looking for:


I’m facing the same problem.

Having an overlay isn’t an option for us sadly.


This post seems to be related: Using the JavaScript embed with Forms

The post shows that the default behavior of asp.NET is prevented out of the box by Swiftype.

However, the question still remains. Since the documentation of Swiftype shows that you need to add a form element around the input and button in order to make it work, as you can read here:

But since Sharepoint adds one big form around the entire document, then that limits your option if you’d for instance there is a action assigned tot the asp form (always by default) want two Swiftype engines on the same page.

The article states that:

Who doesn’t like buttons? To add a submit button to your search input, you can wrap the input code in a form container element and add a button element. All styling of the submit button is up to you! You can find an example below.

  <input type="text" class="st-default-search-input">
  <button type="submit">Submit</button>


This seems to be a workaround:

It basically states that you can use HTML 5 to attach a specific form to an action. Meaning that you can append a dedicated from outside the form using jQuery, and using that for the Swiftype submit.