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.

2 Answers 2

2
$('#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.

Sign up to request clarification or add additional context in comments.

Comments

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

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.