Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

grab elements in html table

Posted on 2013-05-29
1
Medium Priority
?
344 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:
Meir Rivkin earned 2000 total points
ID: 39204675
try this:
$('input[type=text]').each(function(){      
});

Open in new window

0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Question has a verified solution.

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

In case you ever have to remove a faulty web part from a page , add the following to the end of the page url ?contents=1
When using a search centre, I'm going to show you how to configure Sharepoint's search to only return results from the current site collection. Very useful when using Office 365 with multiple site collections.
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…
Suggested Courses

885 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