form multi select list insert records
Hi Ray, as discussed recently on a premiere ticket I wanted to look at using some code I found to allow client to do a multi select from a drop down and then save each into records.
So I need to somehow loop through each item that's selected in the multi select list on the form and perform an insert.
Also inside the multi select list I have grouped the sub-categories (child) into their corresponding parent category (at the moment its only displaying the ID value rather than the name, so I need to tweak the recordset that can do this (since the same table is storing both parent and child).
So I wonder upon form submit, what would the process be to do a multi insert for each value in the multi select list? I wanted to try myself before we use up the remaining support ticket I purchase.
I am providing the code and screenshot as reference.
<select style="width: 260px;" multiple="" class="chosen-select">
<?php
while(!$rsCategory->atEnd()) { //dyn select
?>
<?php
if ("".($rsCategory->getColumnVal("CategoryParentID")) ."" != "0") { // WebAssist Show If
?><optgroup label="<?php echo($rsCategory->getColumnVal("CategoryParentID")); ?>">
<?php
} // ("".($rsCategory->getColumnVal("CategoryParentID")) ."" != "0")
?>
<option value="<?php echo($rsCategory->getColumnVal("CategoryID")); ?>"><?php echo($rsCategory->getColumnVal("CategoryName")); ?></option>
</optgroup>
<?php
$rsCategory->moveNext();
} //dyn select
$rsCategory->moveFirst();
?>
</select>
Chris