View Single Post
Join Date: Jan 2008
Posts: 62
Reputation: hooray is an unknown quantity at this point 
Solved Threads: 6
hooray hooray is offline Offline
Junior Poster in Training

Javascript change text box fields

 
0
  #1
May 23rd, 2008
Hi guys,

I am trying to make a javascript function that will add "000" to the end of a textbox value if the user presses k and also add "000000" if they press m. So i don't want the k or m to appear in the textbox and some 0's to appear instead. If anyone could help me out with some code id be very grateful.

Thanks everyone

This is where I am at now (Ive done the easy bit, cant find out about detecting if k or m is pressed)
  1. function addZero(x) {
  2. if//I dont know how to find out if it is a k or m
  3. {
  4. x.value += 000;
  5. }
  6. }
Last edited by peter_budo; May 24th, 2008 at 7:57 pm. Reason: Corecting closing tag
Reply With Quote