This has always bugged since if Mech is going to be useful for testing it's almost required that you mess with hidden fields because sometimes your JS will do it, or you want to make sure you've protected yourself against elementary hacking attempts.
Anyway, I always forget how to work around this, so I'm putting it here to always remind myself. If you have a hidden input named 'rm', this is how you would make it settable for Mech:
my $form = $mech->form_name('my_form');
$mech->set_fields(rm => 'foo');