Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Posting textareas and textboxes via jQuery Post

Posted on 2009-07-06
2
Medium Priority
?
606 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 12

Accepted Solution

by:
kevin_u earned 2000 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

DOM Attributes and Properties treatment with jQuery 1.6 by Ivo Stoykov jQuery (http://jquery.com/) 1.6 introduces .prop() (http://api.jquery.com/prop/) and .removeProp() (http://api.jquery.com/removeProp/) methods which allow modifying or removi…
PROBLEM: The other day I was working on adding an ajax request to a webpage that already had a dialog box on the page.  The dialog box was using relative positioning to be positioned next to a form field I had on the page.  Everything was working…
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…
Suggested Courses

609 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