0

<form action="checkbox.php" method="post"> <div class="checkbox"> <label><input type="checkbox" name="size[]" value="s">S</label> </div> <div class="checkbox"> <label><input type="checkbox" name="size[]" value="m">M</label> </div> <div class="checkbox"> <label><input type="checkbox" name="size[]" value="l">L</label> </div> <div class="checkbox"> <label><input type="checkbox" name="size[]" value="xl">Xl</label> </div> </form>
here is my html code i want to selelct more then one checkbox, and it will fetch data from databse respectively from the selelct checkbox.
please tell me what to do?
here i dont want to use <form> tag.

Edited by Podu

3
Contributors
2
Replies
14
Views
1 Year
Discussion Span
Last Post by AndrisP
0
$("[checkbox]").each(){
    $(this) 
    //this is your checkbos 
    you can elaborate val and attributes 
    send to the server via $.post(...)
}

Edited by TexWiller

0
<?php
$selectedSizes = ( isset($_POST[size]) ? implode(",", $_POST[size]) : "" );
$sql = "SELECT * FROM `your_table_name` t WHERE FIND_IN_SET(t.`size_field`, ?)";
// then bind param $selectedSizes and execute query
?>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.