Solved

grab elements in html table

Posted on 2013-05-29
1
340 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

Space-Age Communications Transitions to DevOps

ViaSat, a global provider of satellite and wireless communications, securely connects businesses, governments, and organizations to the Internet. Learn how ViaSat’s Network Solutions Engineer, drove the transition from a traditional network support to a DevOps-centric model.

Question has a verified solution.

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

Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
I thought I'd write this up for anyone who has a request to create an anonymous whistle-blower-type submission form created using SharePoint 2010 (this would probably work the same for 2013). It's not 100% fool-proof but it's as close as you can get…
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…

713 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