Solved

grab elements in html table

Posted on 2013-05-29
1
336 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
Comment Utility
try this:
$('input[type=text]').each(function(){      
});

Open in new window

0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
JQuery & CSS Tab Issues 7 26
coldfusion, javascript onclick url update 4 25
JavaScript error 1 33
jQuery Scroll Speed 3 18
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
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)

771 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

16 Experts available now in Live!

Get 1:1 Help Now