Solved

Posting textareas and textboxes via jQuery Post

Posted on 2009-07-06
2
592 Views
Last Modified: 2012-05-07
I need to be able to post values from textareas and textboxes. Any idea how this can be done? The attached example does not work.

Thanks in advance.
<html>

<head>

<!-- jQuery Script URL -->

</head>

<body>

  <textarea name="text1"></textarea>

  <input name="text2" value="">

  <span onClick="$.post('/index.php', {str1: text1.value, str2: text2.value})">Submit</span>

</body>

</html>

Open in new window

0
Comment
Question by:DReade83
2 Comments
 
LVL 12

Accepted Solution

by:
kevin_u earned 500 total points
ID: 24786995
<html>
<head>
Add id= to your tags.
This should get you closer... I didn't examine the post logic closely.

<!-- jQuery Script URL -->
</head>
<body>
  <textarea id="text1" name="text1"></textarea>
  <input id="text2" name="text2" value="">
  <span onClick="$.post('/index.php', {str1: text1.value, str2: text2.value})">Submit</span>
</body>
</html>


0
 

Author Closing Comment

by:DReade83
ID: 31600236
Thanks! :)
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction HyperText Transfer Protocol (http://www.ietf.org/rfc/rfc2616.txt) or "HTTP" is the underpinning of internet communication.  As a teacher of web development I have heard many questions, mostly from my younger students who have come to t…
Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now