If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Enjoy an ad free experience by logging in. Not a member yet? Register.

Pure JavaScript AJAX Search with JSON

I'm basically brand new to JS but I have been working on this script all week and can't get the JS to work...

Please help me understand why my text input does not POST its value to parser.php. The PHP file has been tested and gathers/echoes JSON data perfectly from any search input with a post action. I cannot get this JS function to send my searchquery data to my parser.php. I'm sure its a basic issue.

Thank you!

Your advice made the script call to the PHP file. My code was a bit off but nonetheless I could figure it out once I had your fixes, so thank you. The only problem now is that the form field input[text] refreshes the page on enter and submits blank when the enter key is pressed and only sends the search query data when the button triggers "onclick".

What would you do to get the field to submit also?
I'm playing around with the onkeyup code below but could use some advice...

Combining both of these JS's did the trick... Now the enter button when typing within the form submits the data to my AJAX function as does clicking the actual button.
I'm guessing that onsubmit="return false;" kills the default submission method? (which is the enter button)