I have a dropdown menu (Select) that loads a bunch of data form my table. I'm trying to insert each value into another table on clicking each selection but I have no clue on how to go about this. I've been looking around and there is nothing much I can find.
Here's my dropdown code:
<select id="theSelect">
<option value="select">Select all that apply.</option>
<?php
for($i=0; $i<count($preferences); $i++){
?>
<option value="<?php echo $preferences[$i]['pname'];?>"><?php echo $preferences[$i]['pdesc'];?></option>
<?php
}
?>
</select>
What I want to do is each time I select a value from the dropdown, it makes an ajax request that inserts that value into another table. Is that possible?
I would really appreciate some help with that.
Thanks.