I've been spending a lot of time with jQuery lately and have been really digging it. In fact, I'm doing a short grok
talk on it for the Dayton .NET Developers Group at the end of this month.
Here's a short snippet I came up with to resize text boxes so that the width of the textbox would be proportional to the maximum number of characters allowed by the maxlength property on the textbox. It's not
exact - through trial and error I figured out that 7.3 and 8 work as ratios for maxlength value to the corresponding width. That's based on the font I'm using and
the size of the textboxes (smaller ones seem to have a slightly different ratio than larger ones). You'll probably have to tweak those values to get what you need, but it's
a start.
$('input[type=text]').each(function() {
var max_length = $(this).attr('maxlength');
var multiplier = (max_length > 10) ? 7.3 : 8;
var w = (max_length * multiplier) + "px";
$(this).width(w);
});