Solved

grab elements in html table

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

Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

Question has a verified solution.

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

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…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn how to dynamically set the form action using jQuery.
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)

705 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