. , jQuery 1.6 jQuery UI 1.8:
HTML:
<div id="checkout">
<h2><a href="#">Section 1</a></h2>
<div>
<form action="#">
<h3>Content</h3>
<input type="submit" class="next" value="Continue" />
</form>
</div>
<h2><a href="#">Section 2</a></h2>
<div>
<form action="#">
<h3>Content</h3>
<input type="submit" class="prev" value="Back" />
</form>
</div>
</div>
JQuery
<script type="text/javascript">
$(document).ready(function () {
var checkout = $('#checkout').accordion({ event: false });
$('form', checkout).each(function (index) {
$(this)
.children(':submit')
.filter('.next, .prev')
.click(function () {
checkout.accordion('option', 'active', index + ($(this).is('.next') ? 1 : -1));
return false;
});
});
});
</script>