Hello there, this is pretty basic ajax but I'm still not good at it. I found some tutorials however many of them don't explain stuff and also I need a different thing. I have a form. I type something in a search box. I pick something from that "auto-suggest". When I click that something from the list I have 2 fields that get populated. ID + name (this part is already done) However, when that 2 fields are populated I want to make a PHP Query and check if that ID is already in my database. After I check it, if the product is in the database I want to echo a message in a specific DIV. Also, how do I call that function since the field is automaticly populated and not typed. I don't know if "onkeyup" works. Any suggestions? I know I have to send the detail with POST, but I don't know exactly how, and also I don't know how to populate a DIV with the message.
I suggest the use of jQuery to do this, it'll make it a lot easier. Don't have the time to baby you through the whole thing at the moment, just google jquery and read some tutorials
jquery is a great js library, but if you want to do it the old fashioned way, googling is the best way to learn
go with jquery as garrettheel told u , if u dont know what jquery is ... http://jquery.com/ it's not a script , and its not magic ... u need to write code but it save you a lot of time , instead of writing 100 lines it will take few ...
well said sir, but i think he want to go with pure js without any help from libraries so it's all up to the OP's discretion