SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We need to post to a search web application and have it display the results in a new window. Can the SharePoint 2010 HTML Form Web Part do this? Any examples? Thanks.

share|improve this question
Are you sure you need to POST? Search works fine when you do a GET with the search query in the query string. – GavinB Mar 5 '12 at 19:59
Thanks, GavinB. I'm good with either method, as long as it works :) – Alex C Mar 6 '12 at 6:02
up vote 0 down vote accepted

This does the job: It even lets you define whether to pop the form up in a new window or to do a POST or GET. You just have to ensure jQuery is loaded, then call the function:

<script type="text/javascript" src="/SiteAssets/js/jquery.SharePointFormSubmit.js"></script>
<div id="divIdForm">
  <input id="all" width="29" size="29" autocomplete="off" name="all">
  <button id="idButton" type="button" onclick = "jQuery().SharePointFormSubmit(
          'frmAction': 'http://myserver/search.aspx',
      if(e.which == 13){
                'frmAction': 'http://myserver/search.aspx',

I go a step further and also call the submit if the user hits enter in the input field. Put the whole thing in a content editor web part and you're off and running. The SharePointFormSubmit function replaces the DIV wrapper with a form and submits the information.

Hope this helps others.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.