mmmm ... chili ..
are you talking about after being submitted or before? you can only get info on 'form fields' with javascript .. but after you submit the form, then you are dealing with variables.
some example code would be cool .. but if my "assum"tions are correct, you want to determine the length of a string.
PHP Code:
<?
$str = 'abcdef';
echo strlen($str); // 6
$str = ' ab cd ';
echo strlen($str); // 7
?>
http://www.php.net/manual/en/function.strlen.php
is that what you were looking for?