Solved

grab elements in html table

Posted on 2013-05-29
1
338 Views
Last Modified: 2013-05-29
So I had a form created using jquery and it worked great until I embedded it in a CEWP, which does not like form tags.  How can I covert the following to get the elements in my table?

$("form :text").each(function(){      
});


My table is generated dynamically and can have any number of elements. Here's an example of what my html table looks like:

<table id="initiative" border="1" width="65%">
<tr>
      <td>name</td>
        <td><Input type="Text" name="fname" value="">
</tr>
<tr>
      <td>phone</td>
        <td><Input type="Text" name="phone" value="">
</tr>
<tr>
      <td>email</td>
        <td><Input type="Text" name="email" value="">
</tr>
</table>

How can I grab just the text boxes?

Thanks!
0
Comment
Question by:Isaac
1 Comment
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 39204675
try this:
$('input[type=text]').each(function(){      
});

Open in new window

0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
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…

815 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

12 Experts available now in Live!

Get 1:1 Help Now