How to pass string data from textarea using Jquery ajax as a parameter to a servlet?

How to pass string data from textarea using Jquery ajax as a parameter to a servlet?

I have a text area in html in which a user will paste a long string of data (with spaces) which needs to be entered into the data base. The user will click a button upload which will call a javascript function inside which I am giving a jquery ajax post call in which I need to pass that parameter to the servlet which is mentioned in the url. Following are my codes:

<textarea id = "string" rows = "20" cols = "120" > Please enter the data </textarea>


<input type = "button" value = "upload" onclick = "UploadResult(getElementById('string'.val());" >

function UploadResult()
{
var elementValue = $("#string").val();
$.ajax({
     type: "POST",
     url: "servleturl.irpt?",
     data: "elementValue",
     success: function(msg){
                 alert( "Data Saved: " + msg );
    alert(elementValue);


              }
});
}
















I am unsure of the syntax here, I want to know how to pass data from html textarea as an input paramater to a servlet (this will call query to insert string data into the tables)? The second alert alerts the proper string ,meaning the string does go into Elementvalue....but for some reason it is not going to the url..as I am unsure of the syntax.....Any help on this will be highly appreciated...I need to get a answer to this asap. Please help me guys..

Thanks, raj4418