/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Select all checkboxes by checking one

I have data in MySQL database which are displayed in my index.php page. For each line I have a check box, and also one checkbox at the end. I want all my checkboxes to be selected automatically by checking the one at the end. This works for the case when I am not reading from database, but just for specified checkboxes (in this case I do the following).

function checkAll(MyForm)
{
if (MyForm.everything.checked)
{
MyForm.aaa1.checked = true;
MyForm.aaa2.checked = true;
MyForm.aaa3.checked = true;
}
}

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@SheldonApr 08.2008 — Are you trying to do this with Javascript ?

Can you explain more or provide a link ?
Copy linkTweet thisAlerts:
@harevik85authorApr 08.2008 — Are you trying to do this with Javascript ?

Can you explain more or provide a link ?[/QUOTE]



Yes I have tried with JavaScript, but didn't succeed. I want to delete all the Emails from my database for which the check box is selected (by selecting the one which is just after this words)

<input type="checkbox">

$result = mysql_query("select * from address_book");

$num = mysql_num_rows($result);

while ($row = mysql_fetch_array($result))

{

echo "<input type='checkbox'>".echo $row['address_book_Email'];

}


Sorry I can't provide a link as it is in my localhost yet. Thank you very much
Copy linkTweet thisAlerts:
@harevik85authorApr 09.2008 — Thank you sooooooooooo much, it worked?
×

Success!

Help @harevik85 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,
)...