?
Solved

Posting textareas and textboxes via jQuery Post

Posted on 2009-07-06
2
Medium Priority
?
605 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

There are a couple ways to attach a JavaScript function to dynamically created elements. You can make a new script for each element as it’s created or you can use delegation. Delegation allows a single script that is added at page creation to mat…
How to build a simple, quick and effective accordion menu using just 15 lines of jQuery and 2 css classes
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
Course of the Month10 days, 6 hours left to enroll

765 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