How to make up a form that is going to be a search box and work only via Ajax? That is:
1) What to put as the form’s action value? (action=”what”)
2) How to submit it so that nothing else happenes except for calling the JavaScript function?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can do something like:
dosearchwill be something likesearchpage.php will search the DB as needed and then return, for instance, a JSON string (e.g. by storing the results in an array and using
json_encode) or XML or even straight HTMLFinally, the
onReturnfunction will go through the results and print them for instance in a list, like this: