Hi guys so i have just started learning php and was able to figure out how to do a search function from my database to get information. The only bit which does not work so far is that fact when i get that information, and the user clicks on Add it does not seem to work. So what i want to happen is like a shopping list. The user searchs through my database and finds the thing he wants. Then clicks Add. Below the search box anther box will appear with that word. So he knows it has been added. Then after this i can add a cross and they can click it and get rid of the item if they want. However i have tried solutions to this problem but cant seem to get anywhere. Any help in getting this problem to work would be great.
Code so far:
<input type="text" name='search_term' id="search_term" class="searchFunction">
<input type="submit" value="Add">
<div class="dropdown">
<ul class="result"></ul>
</div>
I have tried the onscreen click function , but i just hit a dead post doing this, so any help would be great. Something to get me started so i can start playing around with code and seeing what i can do etc.
Basically yes, once the user clicks add from the returned result, below that i want a box to appear with that name , so example : Example You see how when u search for an ingredient on there site and then click add , it appears below it? This is what i want
P.S i know about the sql injection :) but one step at a time for now x
$('.result').on('click', 'li'..., how did you do that if you don't know how to do it?