Jump to content

Write form's html input value to a log file via ajax request during compilation


Recommended Posts

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  :)

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.

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.