tags:

views:

34

answers:

2

Can you guys help me out with this? I've got a form and it has a textarea where the user will paste in some text. I want to use jQuery to send the text they paste to a php script which will decode it and output some information. I've got a div, and I want that div to be updated with the html my script outputs.

A: 
$('#target').change(function() {
  $('#divname').load('phplocation');
});

Target being your textarea id. Divname being your divname id. phplocation being the php file location and variables.

Gazler
+2  A: 
$('#target').change(function() {
  $.post('.php', {text: $(this).val()}, function(data){
      $('#divname').html(data);
    }
  )
}

This code is more right :) Script send textarea value to php($_POST['text']) and set the result text into the div.

Adelf