<form onSubmit="return func('1');"> ... </form>
function func(x) { switch(x) { ..... case "1": ... if(...) { return false; } break; ..... } }