Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    TrainReq
    Guest

    Setting max length to things

    Alright.. say if excape(name) is longer than 15 charicters , shorten it up into 8 charicters. .. how would I go about doing that.

    As well as if excape(this) is blah change to meep

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,922
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    Is this what you mean?

    <SCRIPT type="text/javascript">
    function shorten() {
    name = "abcabcabxyzxyzxyzxyz"
    if (name.length>15) {
    name = name.substr(0,8);
    alert (name);
    }
    }
    </SCRIPT>

    excape?? charicters??


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •