Click to See Complete Forum and Search --> : Textbox fixed width with content in the textbox


mtdowling
04-24-2006, 01:30 PM
On my webpage I have a textbox that holds the email address of someone logging in. I specify the textbox to have a witdth of 98% of a TD and the TD it's in has a width of 68% of a table. When the user comes to the page where the textbox is, a cookie places the value of the last email address entered into the textbox. If the email address is really long the TD and the textbox get blown up to the actual size of the email string, but I just want 14 letters to be visible and the rest to be just hidden to where you would have to move the text cursor to see or edit the rest... Here is the code:

<td width=68% style="table-layout: fixed;">
<input style="height:16px; font-size:9px; border-color:<?PHP print($CS[$LeftWindowHeader]); ?>; border-width:1px; width:98%" type="text" name="loginemail" value="<?PHP print($_COOKIE['gb_username']); ?>" size=14>
</td>

johneva
04-24-2006, 01:57 PM
Not sure it will work but try


overflow: hidden;

mtdowling
04-24-2006, 02:03 PM
that didn't work either...seems like it should though. here is the code I used:

<input type="text" name="loginemail" value="<?PHP print($_COOKIE['gb_username']); ?>" size=14 style="overflow: hidden; height:16px; font-size:9px; border-color:<?PHP print($CS[$LeftWindowHeader]); ?>; border-width:1px; width:98%">

kink
04-25-2006, 10:30 PM
ad a width attribute and see if that works css always fits the value in the box
if that doesnt work try maxlength="14"

johneva
04-26-2006, 04:53 AM
But maxlength will retrict the length of the email address which is not what is wanted.

Though if you do as has been said give it a width and then use the overflow that might fix it as thats why the overflow might not have been working before.