Solved

Posting textareas and textboxes via jQuery Post

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

Suggested Solutions

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…
Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
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…

773 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