Skip to content
Advertisement

OnClick Send To Ajax

I’m trying to complete some ajax requests to insert a textarea into a database without refresh. Here is my code:

HTML:

JavaScript

JS:

JavaScript

My Questions:

1) How do I send the contents of the text area into the onclick function?

2) How do I escape/urlencode etc.. So it retains line breaks

Advertisement

Answer

JavaScript

You have few problems with your code like using . for concatenation

Try this –

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement