I've created a form which allows users to search for brands through a jQuery autocomplete function. The selected brands get added to the page and must be eventually stored in the MYSQL database. The problem is how do i get these added brands stored in my database. Here is my code
jQuery:- $(document).ready(function() {
- $("input#autocomplete").autocomplete({minLength: 2 });
$("input#autocomplete").autocomplete({
source: ["Adidas", "Airforce", "Alpha Industries", "Asics", "Bikkemberg", "Birkenstock", "Bjorn Borg", "Brunotti", "Calvin Klein", "Cars Jeans", "Chanel","Chasin", "Diesel", "Dior", "DKNY", "Dolce & Gabbana"]
});
$("#add-brand").click(function(){
var merk = $("#autocomplete").val();
$("#selected-brands").append(" <a class=\"deletemerk\" href=\"#\">"+ merk+ "</a>" );
return false;
}); - });
HTML:- <div id="brands-form-holder">
<form id="brands-form" action="" method="">
<dl>
<dt><h1><label for="brands-form-brand">Add your brands</label></h1></dt>
<dd>Search for brand:
<input id="autocomplete" type="text" name="brand" />
<input id="add-brand" type="button" value="Add brands" />
</dd>
</dl>
</form>
<hr />
<p class="section-title"><strong>Brands selected</strong> (including from the database)</p>
<div id="selected-brands">
</div>
</div>