
December 29th, 2000, 05:40 PM
|
|
Junior Member
|
|
Join Date: Dec 2000
Posts: 11
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
is there an easy way to have an array built from elements present out of a given group. for example: i need to build an array out of days of the week that i work. my array starts with days[0] = monday and work up to days[6] = sunday.
i set my form with check boxes representing days of the week and then script the array to be deleted if a day off is selected...
if (document.addprofile.SundayOFF.checked) {delete dayArray[6];}
else {dayArray[6]=SundayON;}
the problem i get with working this way is that when i alert(dayArray) , i still get values that are included even if not defined.
i'm looking for a way to get elements selected and then "pushing" non selected elements into an array
i'd like to think of it as a varaible where you can do something like var variable += "Monday" ..i guess i'm thinking all over the place
|