# Can Javascript save text in input fields?



## scrubbicus (Jan 23, 2009)

So I have some javascript in my field that reveals certain areas when they click on certain things. Unfortunately if there was any typing before hand and they click on those certain fields when the page reveals those areas all the text fields reset. So I guess there's two ways I can fix that is if there was some javascript or some other language that saved the text as they were typing it then I can probably find a way to pass that info with PHP (i've seen websites when people type info it checks what they're typing as they are typing it which is cool). The other way is if I could have some javascript that didn't refresh the page. I'm not too hot with javascript but any help is appreciated. Thanks


----------



## MRdNk (Apr 7, 2007)

Hey Scubbicus,

It sounds like what your looking for is Ajax (asynchronous JavaScript and XML).

JavaScript defines an xml document, and calls php using $_GET (but doesn't send to the browser) and then returns the php result (a database query) - the JavaScript then return the value to the web browser page only changing the element you define to change.

Check out: w3schools.com
http://www.w3schools.com/php/php_ajax_database.asp


----------



## techSeekerX (Apr 16, 2007)

Hi
might be a late reply but it will be easy for us if you could provide a url of the page you are talking about (and if you are still stuck in this problem  )

cheers


----------

