<?php
/**
* This won't work when you first submit it... the hider will still show 3.
* Change #value to #default_value on the hidden field for it to work.
*/
function test_form() {
$form['hider'] =
array('#type' =>
'hidden',
'#value' =>
3);
$form['submit'] =
array('#type' =>
'submit',
'#value' =>
'Submit');
return $form;
}
function test_form_submit($form_id, $form_values) {
}
?>
<script>
$('#edit-hider').val(5);
</script>