I know you can use the normal size attribute, but is there any way (with CSS maybe) to define it a little more exact (for example with a px number? The reason I ask is it's really ugly when you have one long field, with two smaller ones on the next row, but no matter what size values you use, they can never be the same total width.
input { width: 200px; } Will make all your <input /> fields 200px wide. textarea { width: 200px; } Will make all your <textarea></textarea> fields 200px wide.
MORE: you have the CSS for input and textarea. Let's say you want the buttons look different. <input type="submit" value="submit" class="buttons" /> the CSS: input.buttons { width: 100px; background-color: red; }
Although the "size" attribute may not get the precision of the "width" style attribute, remember that it is not supported in some older browsers. In these cases, it will use the default size, regardless of the width you put in the style tag. However, most browsers nowdays support this. Robert Fuess Spiderweb Logic
Related to this - is there any way to put a maxlength on a multi-line textarea? I know you can for a regular form field. Thanks.
Perhaps wire an "onchange" javascript function . . . When the text changes 1) check the length 2) if > max, truncate to max 3) put cursor at end of field
You're better off popping an alert saying the limit and how long the field is, the person may want to cut out text from the beginning to fit the limit as opposed to the text you arbitrarily chopped off of the end.