is this pseudo-code?
If not I would rewrite it like:
$form = $('#form_id'); function hide_element() { $$form.hide('#form_id'); $form.hidesubmit(); } function show_element() { $$form.show('#form_id'); $form.showsubmit(); } And then:
<button onclick="show_element();">show</button> <button onclick="hide_element();">hide</button> <form> ... </form> I removed the type submit because it is not good to have more than one submit. Actually both are outside the form. In case you want to submit it I would put it like this:
<button onclick="show_element(); $('#form_id').submit()">show<;">show</button> <button onclick="hide_element(); $('#form_id').submit()">hide<;">hide</button> <form> ... </form>