Jquery and $.post for write on the file

Hi,
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.
thanks

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.

Hi
I found the following code:
$.post(‘save’,
{id: $editable.attr(‘id’), value: contents},
function(data) {
$editable
.removeClass(‘active-inline’)
.contents()
.replaceWith(contents);
});
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#?
thanks

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.