JQuery :: Show And Hide Rows With Matching ID's?

Apr 5, 2011

I have a script that prints out a lot of <tr>'s, each has a different id, let's say it's a number. What i am trying to get is when a user enters numbers in a certain textfield, named #idtext for example, it shows only those <tr>'s whose id numbers matches the entered value and hides the rest. For example, user enters 23 in the text field, rows with id numbers 123, 23, 231 are shown, the rest are hidden, etc.

Atm i have smoething like this, not working:

$("#idtext").change(function(){
var val = $("#idtext").val();
$('tr[id^<>'+val+']').hide();
$('tr[id^='+val+']').show();
});

View 4 Replies


ADVERTISEMENT

JQuery :: Show/Hide Table Rows

May 4, 2011

I have a table that is set up to look like a menu and would like to show/hide certain rows, the problem is that the rows do not have id's...basically, it looks like this:

<table class="mainTable">
<tbody>
<tr><td class="Level1 Selected"><a href="page1.aspx">Page 1</a></td></tr>[code]....

Ultimately, what I would like to do is: show all Level1 rows.hideadditionallevels below Level1 (which could be any number deep)
and finally, if row is selected then show additional levels below (td class will change to "Selected" when on the page) and above (ie. if Level2 is selected).

View 4 Replies View Related

JQuery :: Show / Hide Table Rows Based On Groupnames

Oct 21, 2011

Say, for example, I have a table with an undefined number of rows. Row 1 contains number 1 to 10, row 2 contains 11 to 20... you get the picture. The table is autogenerated and id's are made unique by the system (GUID's plus id). I am able to add a 'name'attribute to'img''sthat are in the td's and add a groupname i.e. '11to20'. Using this i want to test showing/hiding grouprows. Now I have a dropdownlist on the page where the user selects the groupname from
i.e."11to20". I would like to be able to hide the rows not having the selected groupname
and show the rows that do. I've constructed a query that would hide the selected groupname but it hides all tr's.
$(obj).attr('name', obj.options[obj.selectedIndex].value).parents('tr').siblings().fadeOut('fast');

Here's the (simplified) sample html I constructed by hand for this message:
<fieldset class="my-form"><div>
<div class="NumberSelector"">
<label for="ChooseNumber">Choose a number</label>
<table id="ChooseNumber" cellspacing="10" border="0" style="width:542px;">
<tr><td><label for="ChooseNumber_1">
<img name="1To10" src="/images/number1.jpg" alt="number1" onclick="ImagePopup(this);"/> .....

View 3 Replies View Related

JQuery :: Hide/show Table Rows With An Onclick Event?

Jan 7, 2010

I want to hide/show table rows with an onclick event. Here are the relevant snippets of code I have:

Script:
$(document).ready(function() {
$("#plan1-title").click(function() {
$("#plan1").toggle();

[code]....

It works in all browsers (Firefox, Safari, Chrome, and Opera), however not a single version of IE 6-8 will toggle the table row.

View 2 Replies View Related

Show And Hide Rows Of The Table?

Mar 15, 2011

I ahve this table as code shown below with buttons Up and down above and below the table respectively now whgat i want to do is that as I have ten enteries in the table.I want to show only 6 of them at one go on a page and the rest 4 should be hidden and when I cliock the "down" button the next four should be displayed and vice versa when I click "up" button the first 6 should be displayed.

Code:
<div >
<input type="button" id="up" value="up"/>[code]....

View 2 Replies View Related

Cells Hide/show In Each Of The Rows Of A Table?

Aug 16, 2010

I have a query regarding the hide/show of the cells in a table.The first column is 'Yes and No' options using combo box, 2nd option is 'input field', 3rd column is also 'Yes and No' option using combo box, and 4th option is also 'input field'.What I want is to make a table using JAVASCRIPT, in which if i select 'No' from the first row first column, i want to hide the remaining 3 cells of the first row. Otherwise if i select 'yes' from the first row first column i want to show all the 3 other options of the first row. Also in between if I select 'No' from the first row third column i want to hide the first row fourth column cell. Selecting 'yes' from the first row third column will show the first row fourth column.I want apply the same setting of hide and show cells into the remaining columns also.

By selecting 'no' from first column -> hide other corresponding cells of the row by selecting 'yes' from the first column -> show other corresponding cells of the row

AND ALSO

By selecting 'no' from third column -> hide fourth cell of the corresponding/same row by selecting 'yes' from the third column -> show fourth cell of the corresponding/same row

I have posted this question in the tablular form, but it is now showing in the proper format. Anyone in the forum please help me to make this table using JAVASCRIPT. I need this table within a day or two.

View 3 Replies View Related

Show / Hide Table Rows Via Checkboxes?

Sep 2, 2010

I've got a table that I want to be able to show/hide rows based on what check box is checked. By default, I don't want anything displayed, then if you check a or some of the check boxes you'll see the data.Here is what I have, which has some effect in FF but does not work at all in IE.This is my script (which is part mine, part web-found)

<style type="text/css">
.this {
display: none;[code]......

View 3 Replies View Related

Show / Hide Table Rows, But 1st Row Always Shows?

May 4, 2009

I am generated some HTML / Javascript through the use of some XSLT, and what I aim to do is generate a table with many rows where we always have the 1st row showing (which has a +/- image there for users to click so that they can expand/collapse the rest of the rows in that table). I am having trouble with the Javascript on assigning the relevant class to the rows so that they get hidden or shown.So far my XSL is outputting the following...

HTML Code:
<table class="InfoBlock" cellspacing="0" cellpadding="0">
<col class="report_column_headings">[code]...

I know I am violating HTML here by having many tags with the same ID, but I am just looking for ways to get this to work.what I place in my 'ShowHide()' javascript method?

View 1 Replies View Related

Several Rows In A Table With The Same Id So I Can Show/hide Them In A Block?

May 27, 2009

is it possible to have several rows in a table with the same id so i can show/hide them in a block?I have also tried adding a span around the block of rows but that doesn't work ( I seem to remember you cant hava a span around TR tags?)

View 4 Replies View Related

Show/hide Specific Table Rows

Jan 6, 2006

I've tried some methods mentioned in other topics here, but I can't seem to get any of them to work for this specific problem I have. I'm not very experienced in javascript so I haven't been able to modify any of the other examples to work the way I need it to.

I hope the code gives you some idea of what I need even though it's a bit messy, I think most of it should be pretty self explanatory? Code:

View 4 Replies View Related

Manipulate Table With Show/hide Rows

Nov 11, 2007

I use JS to show/hide a <tr> row but, when I do that, the content show or hide but there still have the space they use to took while visible. In short, the table did not update himself.

Any one have already got this problem or know the solution?

View 1 Replies View Related

Code For Show/hide Table Rows?

Dec 28, 2010

wrote me jvascript code for show/hide table rows.The situation is:

<table 1>
row 1
row 2
row 3[code]...

row 1 and row 4 are in one looping

row 2, row 3 ,row 5 and row 6 are in another one looping.The picture is like this:

1.when page load..

2.only row 1 and row 4 display

3.when row 1 is clicked row 2 and 3 will display

4.when row 4 is clicked row 5 and 6 will display

View 2 Replies View Related

Function To Hide/show Multiple Rows Of Table ?

Jun 14, 2011

I have a table that contains many rows, some in italian with code <td nome='riga_i'>. and some in english with code <td name='row_e'>. I have created two buttons with different background flags: italy and uk, so when one pushes the button with flag uk, the html page will be reloaded with only english rows, and when one pushes the button with flag it, the same page is reloaded containing only italian rows. All the code posted here works well, but I think that the code can be better because to reach this result I had to dupplicate the same function and I don' t like this.

Here the code:

To better the code I have tried in this way but without success ...

View 2 Replies View Related

Show / Hide Multiple Rows For Event Categories?

Aug 11, 2011

Trying to display events on my website based on what my clients want to view. I have 3 checkboxes setup to toggle the connected events, but I can't seem to make the onclick handle more than 1 event at a time.

Basically, I want to know

1) how to display more than one tr row'd event with the selection of any given checkbox.

2) how to have all boxes checked on the page load (checked=true only checks the box with no info showing)

3) AND/OR how to create a CHECK ALL option

4) and, lastly, how to give it a scroll in case I have many events code...

View 2 Replies View Related

Show/hide Table Rows -- Parameter Undefined Error?

Jul 20, 2005

I'm trying to get the following script to work, but I'm getting an error saying "rowID is undefined".

function showhide(rowId) {
var showRow = "Edit_" + rowID
var hideRow = "View_" + rowID
document.getElementById(showRow).style.display ="block";
document.getElementById(hideRow).style.display = "none";
}

I'm building the html using an xsl stylesheet, so I'm passing a
dynamic name attribute as the rowID parameter. When I look at the HTML
source, it looks fine. Please tell me where I'm going wrong...I'm sure
it's simple, just not to me! Thanks, Kathy

Here is a sample of the row source:

<tr id="View_Label" bgcolor="red" valign="middle"
style="display:block">
<td width="70%"><h3>1.*Label</h3></td>
<td width="30%">
<input type="button" name="Edit" value="Edit"

</tr>

....then another row with ="Edit_Label" is used for the input boxes,etc.

View 2 Replies View Related

How To Hide/show The Rows Of A Table Depending On The Value Selected By A User From A Drop Down List??

Feb 15, 2006

I am maintaining a site which is written in ASP. Now i have to create
some new pages.

In one page we have a table with many rows. Now, I want to enable or
disable(showing and hiding also) 2 rows of this table depending upon
the value selected by the user from a drop down list.

View 4 Replies View Related

Function To Hide/show Multiple Rows Of Table - Created Two Buttons With Different Background Flags

Jun 13, 2011

I have a table that contains many rows, some in italian with code <td nome='riga_i'> and some in english with code <td name='row_e'>. I have created two buttons with different background flags: italy and uk, so when one pushes the button with flag uk, the html page will be reloaded with only english rows, and when one pushes the button with flag it, the same page is reloaded containing only italian rows. All the code posted here works well, but I think that the code can be better because to reach this result I had to dupplicate the same function and I don' t like this.

Here the code:

To better the code I have tried in this way but without success ...

View 1 Replies View Related

Jquery :: Adding Rows And Matching Functionality - "Number Of Answers" Button Doesn't Do Anything

Feb 15, 2012

What I want to do which I can't achieve is that I want the functionality of the Option Type, Number of Answers and Answer buttons within each row to match the functionality on top. The problem is that under the "Answer" column within the new row it does not allow the user to select a button and the textbox under the "Number of Answers" button doesn't do anything but just display a number within the textbox.

Step 1: Open the fiddle and you see an options and answers section on top. Open the grid and select option 8. Buttons A to H would appear.

Step 2: Type in 2 in the Number of Answers Textbox.

Step 3: Select buttons A and D, you will find out that those buttons would turn green to show they are selected. Now as you entered in 2 in the Number of answers textbox (step 2), it won't let you select more than 2 buttons, if you do an alert would apear stating you are beyond limit please deselect a button to choose another button.

Step 4. Click "Add Question", a new row is added in the table.

Step 5: In the new row you just created, lets say that oh no I made a mistake, there should be 4 answers not 2 answers and within the table row you just added you changed the number of answers textbox from 2 to 4. My question is how can I get it so that it allows the user to select the buttons (turn buttons green) and deselect (turn buttons white) under the "Answer" column within in the row and that if the user has selected 4 buttons but tries to select a 5th button, it will come up with same error as in Step 3?

View 1 Replies View Related

JQuery :: Toggle Function - Hide/show Table When Hide/show Button Is Pressed

Sep 12, 2011

I am trying to hide/show table when hide/show button is pressed

Problem: The code works fine when I remove 'slow' from line 10. But with 'slow' in line 10 content of toggleButton doesnt change from Hide to Show when pressed.

Code:

View 1 Replies View Related

Adding Table Rows - Putting In A Dropdown Box That Contains Numbers That Will Dynamically Show The Rows

May 1, 2009

i'm creating a ASP page, which is going to have a form in it that needs filling out. part of the form will be a table with a header row, then the next rows will have text boxes that need filling out. is there a way of putting in a dropdown box that contatins numbers that will dynamically show the rows. for example if i select 5, then five rows of text boxes will appear. if i select 14 then 14 appear.

View 3 Replies View Related

JQuery :: Hide Duplicate Rows In A Table?

Aug 24, 2011

I want to hide duplicate rows in a html table.

View 3 Replies View Related

JQuery :: Hide Table Rows That Contain Specific HTML In A Cell?

May 3, 2011

How can I use jquery to cycle through all the table rows I have in a table, and hide the rows that contain a specific HTML value that I pass to jquery?For instance, I have a table full of students, and courses each student is taking. If I want to hide all the rows where the course is Chemistry (regardless of student), how would I do that?I already have captured the HTML value, what I mainly need help with is how to tell jquery to hide ALL of the rows with that HTML value, rather than just the row I click on.

View 1 Replies View Related

JQuery :: Live Mysql Database Querying To Show Number Of Rows?

Jul 27, 2010

Basically i have a form with jqueryui implemented (autocompletes) and I need the form to display the number of current results as the user fills the form, i.e. once the user has finishedinputtingdata into one field, the form will query the database with the current form details and return just the number of results ($mysql_num_rows)

View 2 Replies View Related

Hide Tables Rows

Jan 23, 2007

I have my own library for web-design building - active forms, lists. I
am going to build tabbing component. The complexity in this process
is that all web forms uniformed and are built as TABLEs, where
each field is TR. Tabs have to show/hide some of table rows.

I don't know how TR's properties must be changed in order to hide them
all.
I tried make HTML code like
<TR>...</TR>
....
<DIV id=tab1>
<TR>...</TR>
....
</DIV>
<TR>...</TR>
....

And tried to change visibility of a DIV, but this doesn't work.
How can I change visibility of set of TRs?

View 5 Replies View Related

Hide Rows Javascript

Apr 11, 2005

Seems to work fine in Firefox/Mozilla and IE, IE doesn't work with style.display = 'table-row' but Mozilla/Firefox display the row wrong without so it detects and fixes that also. Code:

View 4 Replies View Related

How To Hide TABLE Rows By Grouping Them Into DIV?

Jul 23, 2005

I try to group several rows in a table into a div and show/hide them by
click on a button somewhere with a javascript link. When clicked, the link
will toggle the style of the div section's style between BLOCK and NONE.

This technique works on normal text fine, but it doesn't work on part of the
table, is there a solution that I can achieve the goal of turning on/off
several rows all together?

View 9 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved