i want to know,how is it possible to check automatic all the checkboxes generated in php while page loading.
i mean if the are for example 20records then all to be checked.

Recommended Answers

All 3 Replies

i want to know,how is it possible to check automatic all the checkboxes generated in php while page loading.
i mean if the are for example 20records then all to be checked.

I am not sure how this relates exactly to PHP. This sounds like an HTML question. As you are talking about checkboxes, I presume you mean checked as in "there is a tick in the box", rather than the validation "to check something".

If I understand correctly, then the solution is very simple. you just need to add the word checked to the input, like so:

<input type="checkbox" name="yournamehere" value="yourvaluehere" checked />

The following is an example that will not appear checked.

<input type="checkbox" name="yournamehere" value="yourvaluehere" />

if xhtml,

<input type='checkbox' name='yournamehere' value='yourvaluehere' checked='checked' />

thankx!its working)))

<input type='checkbox' name='yournamehere' value='yourvaluehere' checked='checked' />
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.