0

I would like to send text inside textarea to php using post method. I created a button, and I can extract the text from the textarea into a variable.

How can I pass the variable to php using POST and NOT using ajax or other libraries? Is there a simple way?

If not, how does ajax do it?

Makketronix
  • 1,131
  • 1
  • 8
  • 28

1 Answers1

1

Do you have to use javascript? If you don't want AJAX, then why not just use a standard HTML form submission? You can setup everything using javascript to build the HTML form and the browser will do the submission for you?

JavaScript post request like a form submit

If it must be javascript, then it might be simplest to use JQuery to make an AJAX call.

http://www.w3schools.com/jquery/ajax_post.asp

Community
  • 1
  • 1
Daniel Scott
  • 5,948
  • 2
  • 28
  • 50