traknet Posted July 17, 2012 Share Posted July 17, 2012 I have a form which will be submitted normally but there are a few fields I want storing in PHP session variables as they are typed in ie. before form submisssion. I was looking at possibly using onkeyup for each of these fields to run a function that stores the current form field value into the session variable. I'm proficient at PHP but don't know much javascript/jquery and have never used ajax. If anyone knows of a simple way to achieve this I would be greatful for suggestions and example code snippets. Quote Link to comment Share on other sites More sharing options...
Jessica Posted July 17, 2012 Share Posted July 17, 2012 Try jQuery's ajax functions. They have tutorials on their site. Quote Link to comment Share on other sites More sharing options...
traknet Posted July 17, 2012 Author Share Posted July 17, 2012 Ok, thanks. I've looked through some of these tutorials and they look good for starting with jQuery so I'll work my way through some. In the meantime if anyone knows of an example or tutorial that is close to what I'm try to achieve I'd be grateful if they could share. I wouldn't have thought it would be too complicated to set a PHP session variable to the contents of a text form field as a user types in it - I thought I'd find an example of this but after lots of searching I've failed to find an easy way to do it. Any suggestions gladly received. Thanks Quote Link to comment Share on other sites More sharing options...
Jessica Posted July 18, 2012 Share Posted July 18, 2012 What you're trying to do is not anything special. Get the text in the field, send it to the php page, save to the session. It's not any special function. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.