Click to See Complete Forum and Search --> : currency format in an input box?
kahlua17
11-26-2003, 10:04 AM
Is it possible to format 3 inputboxes on a form in a currency format? I am having users enter in data from a form, and that data is pulled onto a confirmation page. I have tried using the JavaScript code on this page (http://javascript.internet.com/forms/currency-format.html) , and it does work - however, I am trying to get the field to become formatted when the page loads. Since I will have 3 currency amounts shown (Amount, Tax 1, Tax 2) it would be more user friendly to have the page automatically update the fields and not have the user click on each field to show the formatting. I have tried the onLoad command, and that does not update the format in the field.
Thanks in advance !!
TheBearMay
11-26-2003, 12:32 PM
At the bottom of the HTML page place code that forces the onblur..
...
<body>
....
<input type=text name=Box1 ....
<script>
Box1.focus();
Box1.blur();
...
</script>
kahlua17
11-26-2003, 01:02 PM
^^^ I have tried the code and it does not work for me. Here is what I put in at the end of my coding :
</form>
<script>
Inv_Amt.focus();
Inv_Amt.blur();
Details.focus();
Details.blur();
</script>
</body>
</html>
TheBearMay
11-26-2003, 01:10 PM
Make sure the form has a name and prefix the boxes with that name, ie
<form name='MyForm'>
...
</form>
<script>
MyForm.Inv_Amt.focus();
MyForm.Inv_Amt.blur();
MyForm.Details.focus();
MyForm.Details.blur();
</script>
</body>
</html>
kahlua17
11-26-2003, 01:27 PM
Thanks a million!! :D It worked like a charm !!