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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reflecting the count of some fields

Status
Not open for further replies.

programmher

Programmer
May 25, 2000
235
US
I have a page that includes seven color fields (Color1, Color2, etc.).

I have another field that should reflect the total colors chosen (ex - user selectd 3 colors, the number 3 appears in the Total_Selected_Colors field).

I have used a parsefloat and parseint to dynamically add totals associated with fields; but, I have never attempted to COUNT the number of selected fields and reflect this total on the onchange event.

Can anyone show me how to do this?
 
just check each field to see if it has an accepted value and increment a counter variable of some sort... jared@aauser.com
 
JaredN,

Do you have an example of how I would do this?
 
Are you using select boxes or text boxes? jared@aauser.com
 
onchange of the selectboxes call a function that checks each one to see if it has a certain value (or that it isn't just a "" or whatever you make the default value). then do something like count++. in the onchange handler, be sure to reset count to 0 each time... jared@aauser.com
 
JaredN,

Thanks for the tip. Being a neophyte to this, I will incorporate your instructions once I locate an example from one of the linked pages.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top