So I have this problem.
I have the following form on my webpage:
<form>
<textarea rows="3" id="pasteText"> </textarea>
<button class="btn btn-success btn-block" type="submit" id="paster" onclick="captureText();">Paste!</button>
And I have a JavaScript method to capture the text in the textarea here:
function captureText() {
var value = $("#pasteText").val();
//var sent = "../../lib/_add.php?data="+value;
$.post('../../lib/_add.php', {data: value});
}
I'm trying to send the value inside the textarea to the data in PHP (the add.php adds the data variable to my database). What's the best way to go about it? Everything I've tried so far hasn't worked.
Thanks!