I have a few text fields setup in a web application. When the user click the calculate button it needs to take the fields add them together and then populate another cell with that value. (kinda like a spreadsheet). Is there anyway to initialize the value of the text field to 0 (zero)without having it show the 0 (zero)?? If I set value=0 in the tag, the 0 shows up. If I set a defaultValue=0 I still get NaN as a result if any field is left blank. Thanx
Ryan Headley<br /><a href="http://www.sudovi.com" target="_blank" rel="nofollow">http://www.sudovi.com</a>
I would suggest storing the values of your text fields in variables before performing the calculation. Then perform the calculation on the variables instead of the text field values themselves. That way you can validate them and set them to 0 if they are "" before using them, and the user will not see the value in the text field. [This message has been edited by Bodie Minster (edited March 21, 2001).]
Joined: Jun 28, 2000
Thanx, that's what we did, we just set the value="" then ran if statements on each variable and if == "" then we set it = to 0 thanx...