spinnaker Posted September 22, 2011 Share Posted September 22, 2011 Hi all! This is my first post here :-) I have a problem that I would like to share with you in order to see a possible solution with your help. I need to record the values inserted in all the input fields of a form in a log file formatted in xml. The idea proposed is to use an ajax request - active during the form compilation - to write the value of the input field when the focus goes to the next input. Is it possible? Could you give me any suggestion please? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/247644-write-forms-html-input-value-to-a-log-file-via-ajax-request-during-compilation/ Share on other sites More sharing options...
spinnaker Posted September 22, 2011 Author Share Posted September 22, 2011 I have found this partial solution: var data = 'foo bar'; $.ajax({ url: '/foo.php', type: 'POST', data: { data: data }, success: function(result) { alert('the data was successfully sent to the server'); } }); and then inside your foo.php script read the data from $_POST["data"] and save the contents to some file on the server. Now I think there are jquery method to load the input data inside "var data" and execute only when the focus change. Quote Link to comment https://forums.phpfreaks.com/topic/247644-write-forms-html-input-value-to-a-log-file-via-ajax-request-during-compilation/#findComment-1271702 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.