Click to See Complete Forum and Search --> : onLoad form post data - javascript & html


moxcord
February 14th, 2008, 06:20 PM
Hello,
I have a semi-confusing dilemma. I am trying to pass variables through using url encoding and post form data automatically without the user clicking "Submit"
Essentially the data will almost always be the same, but the information in the database that it will get its information from will change.

I have body onLoad="getSearch();"
with the getSearch function in the code below of course
and I'm trying to just pass ?PropertyType_chk=1 through the url
the idea being it searches automatically using property type 1, no need to hit the search button.. but its not working!

Any help or ideas much appreciated.

PeejAvery
February 15th, 2008, 06:51 AM
This is known as AJAX. Asynchronous JavaScript and XML give the user the ability to send information back to the server without any need to load or reload pages.

Here are a couple examples of AJAX to help you along your way. I would suggest tying them with the onchange event. That way, every time an input changes, then you can send the updated information.

W3Schools AJAX (http://w3schools.com/ajax/default.asp)
My example - populate textbox with AJAX (http://www.peejavery.com/coding/javascript/populate.php)
My AJAX object (http://www.peejavery.com/coding/javascript/ajax.php)