Jump to content

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


spinnaker

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.

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.