
November 20th, 2008, 02:38 PM
|
 |
Standing 3 feet to the left.
|
|
Join Date: Jan 2006
Location: USA
|
|
You don't need jQuery to do this. Javascript substring method. I'm not familiar with jQuery, but use their text-editing functions to get the text, apply that, then return it. (Looks like html() and replaceWith(), maybe.)
Now, are you trying to just remove the last letter of anything, or are you trying to remove the initial for the person's last name? If you only expect a last initial to be entered, then you can safely stick with just substring(). If, however, you are worried also about full last names, you'll have to turn to split() and use the first part of the returned array, or, worst case, use regex.
__________________
I'd rather teach you to fish than give you a fish. I reserve the right to also slap you with the fish.
|