Hi Friends,

I have 5 checkboxes. What I want is.....
I want to check 3 checkboxes so other 2 will be unchecked. After clicking the next button a table will appear and checked checkboxes will show in one column and unchecked will be another column.

Can you give any idea how to solve it. example of code will be helpful

Thanks in advance for your help. :)

In PHP? Here's a short example. Page 1:

<form action="page2.php" method="post">
    <input type="checkbox" name="array_name[]" value="true"><br>
    <input type="checkbox" name="array_name[]" value="true">
    <input type="submit">
</form>

Page 2:

<?php
if($_POST['array_name'] && is_array($_POST['array_name'])
{
    // Loop through checked checkboxes.
    $checked_checkboxes = array();

    foreach($_POST['array_name'] as $key => $value)
    {
        $checked_checkboxes[$key];
    }
}
else
{
    // Nothing was checked.
    echo 'No checkboxes were checked...';
    exit();
}

// $checked_checkboxes now contains the names of the keys of your input array called array_name.
// Do whatever you find necessary :)
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.