<form id="xx" name="xx" method="POST" action="<?php echo site_url(array('xx','xx')) ?>" onsubmit="return _sumbit(this)" />
<input type="submit" id="submit" name="submit" />
<script type="text/javascript">
function _sumbit(_form) {
//dosmoething...
if(xxx) {
_form.submit();
} else {
return false;
}
}
</script>
</form>