Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    2,016
    Tokens
    141
    Habbo
    florx

    Latest Awards:

    Exclamation Javascript help :)

    Hey!

    Thanks for reading this.

    Its appreciated.

    Anyway I need a way of javascript changing the contents of a field while i am typing in it.

    e.g. I type 123456 and it changes it to 12:34:56.

    It needs to change on type also. So if I type 123 it changes to 12:3.

    Ive googled around but didn't find anything. If there is a way of doing this without a javascript library it would be great

    Thanks +rep to all who help.

  2. #2
    Join Date
    Sep 2006
    Location
    Hobart, Australia
    Posts
    593
    Tokens
    0

    Default

    I don't know about what sort of function you're going to develop to do this, but if you want to know how to make a form field execute a javascript command while it's being typed in:

    HTML Code:
    <input type="text" name="test" onkeyup="javascriptCommand();">

  3. #3
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    2,016
    Tokens
    141
    Habbo
    florx

    Latest Awards:

    Default

    That's wrong.
    HTML Code:
     <input type="text" name="test" onkeyup="javascript:Command();">
    It needs a colon :p

  4. #4
    Join Date
    Aug 2007
    Location
    Cardiff, Wales
    Posts
    1,199
    Tokens
    0

    Latest Awards:

    Default

    Uhh. Can't think

  5. #5
    Join Date
    Sep 2006
    Location
    Hobart, Australia
    Posts
    593
    Tokens
    0

    Default

    Quote Originally Posted by FlorX View Post
    That's wrong.
    HTML Code:
     <input type="text" name="test" onkeyup="javascript:Command();">
    It needs a colon :p
    No, no. You don't need the javascript: prefix. I was literally calling the function javacriptCommand().

    Just to clarify, if you were calling the function checkTextBox(), you would do the following:

    HTML Code:
    <input type="text" name="test" onkeyup="checkTextBox();">

  6. #6
    Join Date
    Aug 2006
    Location
    Manchester, UK
    Posts
    2,016
    Tokens
    141
    Habbo
    florx

    Latest Awards:

    Default

    Thread closed. I managed it.

Posting Permissions

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