RSS Forums RSS

Javascript change text box fields

Please support our JavaScript / DHTML / AJAX advertiser: Programming Forums

Javascript change text box fields

Posts: 57
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

  #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. }
  7.  
Last edited by peter_budo : May 24th, 2008 at 6:57 pm. Reason: Corecting closing tag
AddThis Social Bookmark Button
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 10:01 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC