/    Sign up×
Community /Pin to ProfileBookmark

validate checkboxes with different names

hi
can someone help me on how to validate checkboxes that has different names for each checkbox in javascript? i want to validate it to a max number of selection. thanks

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@Arty_EffemFeb 14.2007 — hi

can someone help me on how to validate checkboxes that has different names for each checkbox in javascript? i want to validate it to a max number of selection. thanks[/QUOTE]
Just loop through the elements array of the form, checking the type of each element (ideally after checking that its type property exists). If an element has type 'checkbox' and its checked property==true, increment your counter.
Copy linkTweet thisAlerts:
@luvgalauthorFeb 14.2007 — thanks for ur reply

got the problem solved! ?
×

Success!

Help @luvgal spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.30,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...