well
maybe bit of the code helps
i have field that does accept whitespaces trailing and preceeding, named "ipmi_sensor"
i use as normally type() function
$this->type('ipmi_sensor', ' some name ');
what ideally should happen is the name that is saved in database and also on the form for the 'ipmi_sensor' field should be ' some name '
but it trims it and saves only 'some name'