Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add leading zeroes to input field

Status
Not open for further replies.

sqoti

Programmer
Dec 1, 2000
50
US
I want to have a way that when my users enters a number into a field. It will automatically add leading zeroes up to 11(12 total digits)and submit it with the form. I am having difficulty figuring this out. I can OnSubmit and perform a function that adds the leading zeros, but cannot figure out how to return that value back to the input field and submit it with the rest of the form. Please help if you can. Thanks
 
after you add the zero-s, say
document.your_form_name.your_text_fild_name.value = whatever variable is holding your new number with added zero-s --------------------------------------------------
Goals are dreams with deadlines
 
Thankyou so much. I was close to that solution, but overlooked it. You saved the day! What do you get out of helping? If you are doing this for free that is no good!
 
sqoti,
*lol* this (as well as most other forums of this type) is based on people being happy to share their knowledge with others. That's it. No payment or any other benefits besides shared and gained knowledge.
:) --------------------------------------------------
Goals are dreams with deadlines
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top