JQuery :: Show Only The Selected Tr And Hide The Rest?
Oct 28, 2011I have table in which i want to show only the selected tr and hide the rest.
<tr class="t">
<td class="oppCol cell" id=465>465
</td>
</tr>
[Code].....
I have table in which i want to show only the selected tr and hide the rest.
<tr class="t">
<td class="oppCol cell" id=465>465
</td>
</tr>
[Code].....
i have php code that shows a list of colored boxes and when you click one it changes the color of a div... this works fine as i have used a changecss function... i have these colors in a database with their values and specific color names... what i am trying to do is when a color is clicked it will change the div and also print the color name....i have made a php loop to print all the color names and i have the display as none... how can i add to the onclick function that changes the color to also put the display of the certain color name to "block" and then if you select another color it hides that one and shows the new color.
View 8 Replies View RelatedI have a simple jQuery code that shows or hides a DIV based on the selected value of a select tag. Currently it looks like this and it's working fine:
if (selected == "0") jQuery("#divPublishDate").show('slow')
I want to add an else so that the if the value is anything other than 0, I want to hide the div. What's the proper syntax in this case? I assume this is the short version of an IF statement without the { }.
I am trying to create a script that will display content based on if aradio button is selected, and if the other is selected would hide thecontent. Now, each of these radio buttons are part of a radio group,so their names are the same. Most examples show nput:radio[@name=item] Since I have 2 items that have the same name, I can't usename, so I thought I would try id or value. It isn't working. If I addonly the show, whenever you select either radio button, it shows, andif I add the hide code, it doesn't work at allHere is what I have right now.
$(document).ready(function(){
$('#offices_checkboxes').hide();
$("input:radio[@value=1]").click(function() {
[code]....
I am new to this kind of scripting, so I have not done it before, I have tried to find solutions on the net but none have worked. I have a 'contact us' form, which includes 2 radio buttons to select how they wish to recieve their reply... the first radio is 'email' the second radio is 'phone' When the 'phone' radio is selected, i want the div including a drop downbox to appear to ask what time to recieve a call, but when the 'email' radio is selected, this div does not appear. This is the script for this section.
[Code]...
I have found many nice filter plugins, that let you filter a table,and hide the rest of the items, and only show the item that matches
what was entered into an input dialog.What I would like to do, is use an unordered list instead. Is there any plugins that support this? I have not been able to find any..
I am new to this kind of scripting, so I have not done it before, I have tried to find solutions on the net but none have worked.I have a 'contact us' form, which includes 2 radio buttons to select how they wish to recieve their reply... the first radio is 'email' the second radio is 'phone'When the 'phone' radio is selected, i want the div including a drop downbox to appear to ask what time to recieve a call, but when the 'email' radio is selected, this div does not appear.This is the script for this section.
<span>Best way to reply:</span>
<input type="radio" name="reply" value="Email" id="reply_0" /> E-mail <BR />
<div style="margin-left:270px;"><input type="radio" name="reply" value="Phone" id="reply_1"
[code]....
ive been racking my brain looking for a code solution for this....im a html and css pro....and a javascript heres what im tryna do....i have a form...that has a <option> in it for 6 dropdown options.... in one of those possible options.. when SELECTED...i want the div layer that i currently have under it...to appear and i cant seem to figure it out....heres my code in its entirety i want budget div...to appear when the option website design is selected
[Code]....
I've tried to find a stright forward script which show/hide specific form fields based on a selected option. I've seen many online but non of them was working with me without the need of some coding or tweeks. Does anyone here have such script?
View 4 Replies View RelatedI 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.
I am trying to develop an exam system.Find my code below.I request you to copy the code and save it as an html file .I have 2 problems:
1. Kindly notice that when the quiz is loaded,it shows both the questions by default.I want only question 1 to be visible when the quiz loads.What happens presently is that ,both questions are visible even after I click on the link
Q.1( referring to question 1).However,when I click on
Q. 2,then only question 2 can be seen and then(after clicking on Q.2) if I click on Q.1,then only question 1 can be seen
What I want is that when the page loads only question 1 is visible.Then when I click on Q.2,I can see only question 2 and when I click on Q.1, I can see only question 1.I later plan on adding many questions,so it should be a general solution rather than a solution good only for 2 questions.
2.Also,what I want is that,if someone selects any of the answers of a particular question,it's link color should turn green to indicate to the user that he answered that question.So for,instance,if I select an answer to the first question(select one of London,New York,Seattle,Washington,Chicago), the link Q.1 should turn green.
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:
I have this website: [URL] and see the top bar reading "sign up your restaurant" that appears after approximately 3 seconds after the page loads? What happens when you click close button on the right is that the bar disappears, now this bar appears on every page and what I need to have happen is once it gets closed by the user, it does not appear again for the rest of the user's time on the site. I'm assuming that this can be done by a cookie or something.
View 1 Replies View RelatedNewbie looking for the way have a dialog box and when a user goes to
this page they see *nothing*, Except for a dialog box pop, the box says:
"are you sure?" Yes/No. If user clicks yes they see the rest of the page
- (just some simple html). Else no, they might see a message that says
"go back".
I am new to jQuery and I have a small problem: I have different classes of "Divs". Clicking on the divs that are classified as "draggable" makes a div (id="ok") appear. Clicking on this div shows divs that are classified as "sea". clicking on on of the divs (class=sea) shows two buttons (#show, #swatches). selected divs are colored up. Question: How can I hide the buttons again if no div(".sea") is selected/ clicked on?
[Code]...
I tried using the following code to check if the user has selected a particular option in a single select drop down has been selected, then add a class to a div to display it but it's not working and I can't figure out why. I've tried a ton of other things to but this one seems to make the most sense.
if ($("#existing-subscriber option[value='Yes']").attr('select')) {
$(".information").toggleClass("show");
}
I have a page as below, I hope the form only show Select option when loading, then the input date fields will be displayed if select event category, where are the errors?
Code:
<script src="/misc/jquery/jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$.viewInput = { '0' : $([]),
//THIS IS THE NAME OF THE DIV WRAPPING THE HIDDEN FIELD
'1' : $('#1'),
};
$('#category_class').change(function() {
// HIDES THE INPUT FIELD IF ANOTHER DROPDOWN ITEM IS SELECTED ONCE THE HIDDEN FIELD IS LOADED
$.each($.viewInput, function() { this.hide(); });
// SHOWS THE INPUT FIELD ITEM IF SELECTED
//$.viewInput[$(this).val()].show();
}); });
</script>
<table cellpadding=4 cellspacing=1 width="650" border=0 class='list'>
<tr> <td class='caption'>
<form action="save.asp" name="pvt_spec" method="post">
<table border=0 cellpadding=4 cellspacing=0>
<div id="1"> <tr>
<td nowrap><font size=2 color="#ff0000"></font>Start Date</td> <td class='data'>
<input onClick="this.select()" tabindex="1" type="text" name="s_dt" value="2000/01/01" size="13" maxlength="13" STYLE='text-align=center;'>
</td> </tr> <tr>
<td nowrap><font size=2 color="#ff0000"></font>End Date</td> <td class='data'>
<input onClick="this.select()" tabindex="1" type="text" name="f_dt" value="2078/12/31" size="13" maxlength="13" STYLE='text-align=center;'>
</td> </tr> </div> <tr> <td>category</td> <td class='data'>
<select name="category_class" id="category_class" tabindex=1><option value="1">Base category</option><option value="2">Parent Event Category</option><option value="3">Son Event Category</option></select>
</td> </tr> </td> </tr> </table>
So far i managed to show/hide (the only) 1 textarea if an option is selected, using javascript. How can i show all textareas in form if an option is selected (lets say <option name="active">) and hide if option selected is name="passive"?
View 1 Replies View Relatedthe selected menu with a different color background when a user clicks on a particular main menu item. This works with a ul that does not have child items on it. But ul's with child elements the css does not seem to work and seemed overridden by javascript. What i did was on the program logic that automatically produces the unordered list of menu items, I inserted a class 'sfHover' for li items that is equal to the current page. Again, this works on the menus that does not have child elements. Is there any possible way I can configure a selected menu item showing with a different backround color from the rest of the menus?
View 1 Replies View RelatedI have the following dropdown list box [code]...
I want to show() a textbox and a label based on someone selecting the "is between" option of the dropdown list.
I have multiples of these dropdowns and all of them will have to do the same thing. In other words I have
DDLConditional1 2 3 4... infinite. I've already been able to make the button work that appends new conditionals.
I use jQuery in a sharepoint environment and I have a form with a lookup value(dropdown), I set the selected value of the dropdown from code based on a query string parameter.
When I disable the dropdown the value will be ignored when posting the form, currently I hide the dropdown which will save the value on post but will ot show on page.
The question is,
Can I use jQuery to get the selected value and display this a normal text?
I'm using Superfish nav-bar menu which works just fine (it hides all submenus with their childs) But I also want to one sublink display all childs without need to hover over their parent.
Here is the code:
In this example i want to Link 1 and Link 2, have normal drop down menus which are in normal state hidden. I need to Link 3, always display Sublink 3 including its childs (Sub sublink 3).
I am having problems, basically I have a set of nested lists I need to show and hide
Code:
<ul id="smenu3"><ul id="smenu4">
<li>stuff here..</li>
<li>stuff here..</li>
<li>stuff here..</li>
</ul><ul id="smenu5">
[Code]...
I always want "smenu3" to show with "smenu4" and "smenu5" collapsed... When the user clicks the link, it calls a javascript function to show "smenu4" like so...
[Code]...
I have some divs laid on top of each other. By clicking somewehre specific I want to hide all the divs but except for one - which is related to the point i clicked - to show up.Here is my code so far:The function will be called by something like this:
<a href="javascript:void(0)"><img src="album_emilia.jpg" width="90px" height="125px" onclick="setAlbum('emilia')"/><p>Emilia</p></a>
function setAlbum(album) {
$('.right_nav').each(function() {[code].....
All these divs are in the same from the right_nav-class.I guess the problem lies within line 6, where I want to select the div that should show up and is given as the argument of the function.The commented lines are things I already tried, but didn't work either, especially $(this).style seems to be invalid.It does hide all divs as i want, but the one i want to show again doesn't show up. It just stays hidden...
I got this example code which show rows when click on it, the problem is it shows all but I want if I click on one row it shows that one and hide others.
<head>
<title>Jquery Table Display</title>
<script type="text/javascript" src="jquery-1.2.3.pack.js"></script>
<script type="text/javascript" src="jquery.tabledisplay-0.2.js"></script>
[Code].....
i searched the forum, but did not find a working solution for my problem. IE6/7 are not hiding the divs in the $(document).ready function. Tried also:
$("#closed").css('display', 'none'); document.getElementById('closed').style.display = 'none'; It is working when i add the ID "closed" to the <li>-Element instead of the <div>-Container. All other browsers are working fine.
[Code]...