Checkbox issues
Hi jason,
my checkboxes do not insert (any?) the correct data in my recordset.
any idea? thx for your quick help.
Hi jason,
my checkboxes do not insert (any?) the correct data in my recordset.
any idea? thx for your quick help.
send a copy of your page please.
So, the issue is that you are using multiple selection checkboxes, multiple selection checkboxes pass their values as an array.
you need to convert the array to a comma seperated list.
add the following code at line 1:
<?php
if($_SERVER["REQUEST_METHOD"] == "POST") {
foreach($_POST as $key => $val) {
if(is_array($_POST[$key])) $_POST[$key] = implode(", ", $_POST[$key]);
}
}
?>
then in the insert behaivor, the bindings for the columns that use checkboxes will need to be modified slightly. the code in the binding will have a [] at the end of the checkbox name:
<?php echo((isset($_POST["Sprache[]"]))?$_POST["Sprache[]"]:"") ?>
remove the [] from the end:
<?php echo((isset($_POST["Sprache"]))?$_POST["Sprache"]:"") ?>
hi jason!
thx for helping, now it works.
indirectly you helped me in another threat:)
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.