I am trying to update a value in my php file and present it in a textarea using jquery and ajax. to make it short, I have:
1- A Form with User Input and Submit button and a Text area
2- A PHP file called data.php
3 -and the html file
Here is my codes
<form>
<input type="text" name="name"><br>
<textarea name="wstxt" id="wstxt" cols="40" rows="5"></textarea>
<input type="button" name="txta-update" id="txta-update" value="Update Textarea"  />
</form>
PHP is as simple as:
<?php
$name = "Jordano";
echo $name;
and here is the jquery
$(document).ready(function() {
   $('#txta-update').click(function() {
          $.ajax({ 
              type: "GET", 
              url: "data.php",//get response from this file
              success: function(response){ 
               $("textarea#wstxt").val(response);//send response to textarea
            }
        });
});
});
can you please tell me how I can send the input value to php and update the textarea from new value? Thanks
Update

 
    