How to search eBay API Completed Listings and Sold Listings with search box
You need to process the form and modify the request URLs. You should be doing most of the work server side and not embedding everything in the client code. Typically you would submit the form data to PHP or some other server side script, process on the server and send the results back to the client. Also read the terms and API guidelines. There are limits on the completed items call. And the terms restrict what you display to users regarding statistics about eBay sell thru.