Solved

Posting textareas and textboxes via jQuery Post

Posted on 2009-07-06
2
594 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
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 how to dynamically set the form action using jQuery.
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…

911 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

22 Experts available now in Live!

Get 1:1 Help Now