/    Sign up×
Community /Pin to ProfileBookmark

js – checkbox count – print

Hellow, I want to make function with js,
with who I can count checboxes witch is checked,
page countaines only checboxes and text.
Every text entry is with it’s ID where is one checkbox belove it.
I have about 20 checkboxes and
I want to do thing like this – check 2 or 3 whatever how much checkboxes and send by ID to print.php?=$id page.
And the text I get from datebase what’s why I need ID.

Got smth like this by it’s wrong:

[code]
function checkbox(form)
{
var url = “print.php”;
var all = 0;
var max = form.checkbox.length;
for (var idx = 0; idx < max; idx++)
{
if (eval(“document.form[” + idx + “].checked”) == true)
{
visi += 1;
}
}
alert(“checked” + all “);
}[/code]

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@FangJun 28.2008 — What are [I]name[/I] values of the checkboxes?
×

Success!

Help @wtfn00b 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 5.20,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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