Jquery and $.post for write on the file

I downloaded a sample to write to a file that is entered in an input field, using the $. Jquery post, but it does not work. Can you give me some working example.

Hi marianoross,

Check the below code:

var fieldVal = document.getElementById(“txtfield”);

$.post(‘test.php’, {fieldtxt: trim(fieldVal.value)}, function(data) {

    //trim - This is a function written by me for trimming the string	
   //Write a code in test.php which will accept the passed value and write that data into an file.


I hope above code might help you.

I found the following code:
{id: $editable.attr(‘id’), value: contents},
function(data) {
where “save” is the file, the method post will not write into file directly, but will I need a function in php or java o c#?

Yes, ‘save’ should be the script on your server which handles writing to file. jQuery itself can’t write to the file on server as it’s executed in browser.