Question: I'm trying to make the save button in the message part of the discussion board go back to the team site instead of staying on the discussion board page. I've been looking for a few hours but i havent been able to find much. i tried to insert this code:

```
<script type="text/javasccript">
$(document).ready(function() { 
  var button = $("input[id$=SaveItem]");
  // change redirection behavior
  button.removeAttr("onclick");
  button.click(function() {
  var elementName = $(this).attr("name");
  var aspForm = $("form[name=aspnetForm]");
  var oldPostbackUrl = aspForm.get(0).action;
  var currentSourceValue = GetUrlKeyValue("Source", true, oldPostbackUrl);
  var newPostbackUrl = oldPostbackUrl.replace(currentSourceValue, "mySite.aspx");
  if (!PreSaveItem()) return false;
  WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions(elementName, "", true, "", newPostbackUrl, false, true));
  });
}); 
</script>

```

but it didn't work and i got this error in the NewForm.aspx:

Language Filter: Not Connected

The language filter is not connected. To connect the language filter open the Web Part edit menu and choose "Connections" to connect this language filter to other web parts.

Anyways now i'm lost, any help would be great.

Answer: 
You can change the Source parameter of the new item form querystring like this:

```
http://siteurl/testing/teamsite/Lists/Team%20Discussion/New1.aspx?Source=siteurl

```

When you click Cancel or Save button, the page will be redirected to the url specified. Then no jquery will be required for overriding Save button.

For more details, see this post <http://sympmarc.com/2009/10/20/passing-a-source-parameter-on-the-query-string-with-multiple-other-parameters/>
It didn't work for me either but I eventually made it work by commenting all the lines apart from first variable and outputting it to the console. Console output was telling me that there aspForm is null. So I knew at that instant that "form[name=aspnetForm]" does not exist in the source code. By inspecting the source I manged to find form with id=aspnetForm so I replaced that line of code and voila! 

```
var aspForm = $("form[id=aspnetForm]");

```