[Javascript] INPUT TEXT show last characters

Robert Van Dam rvandam00 at gmail.com
Tue Jan 30 20:09:58 CST 2007


On 1/30/07, Nico Ferretti <ferrettinico at gmail.com> wrote:
> Hi!
>
> I have a page with a lot of INPUT TEXT elements, already filled with URL's
> (so they have long strings within them).
>
> The problem is that I want to show the end of the string, not the beginning
> when the page loads.
>
> For example:
>
> ----------------------
> |https://lists.lat|
> ----------------------
>
> (the end would be
> ech.edu//pipermail/javascript/2007-January/thread.html )
>
> I want to show
>
> ----------------------
>  |ry/thread.html|
>  ----------------------

Other than just making the text field large enough to show the entire
string, I don't think its possible to do what you're asking for.

However, you could hack it to work by having the page load with only
the last X characters in the field and then as soon as someone clicks
in the box, swap the short string for the full string.  Unfortunately,
in some (maybe all?) browsers that might suddenly snap the user to the
beginning of the string which may not be a bit odd.

Rob



More information about the Javascript mailing list