Daily Archives: August 24, 2012

Jquery ui cookies tab lost after form submit 1

I had a form on a tabbed interface and would lose the selected tab after the page reloaded. I found the issue was caused by the different URL that appeared after the form submission. Jquery cookies took this as a different page, so it would not load the last tab. The solution is to specify a common path such as ‘/’ when setting the cookie so it can be read again.

$( "#tabs" ).tabs({
	cookie: {
		expires: 1,
		path: '/'