Home Answers Viewqa JSP-Interview-Questions Help with jQuery show hide div script

 
 


Jason
Help with jQuery show hide div script
0 Answer(s)      2 years and 11 months ago
Posted in : JSP-Interview Questions

Hi guys,

I have a jquery script for showing and hiding the content inside, between two divs, controlled with radiobuttons. I like to use the same jquery script for another group of divs and radiobuttons so I'm trying to create a loop are so inside jQuery.
Could somebody please help. Thx in advance.

<!----------------- my script ---------------------->

showhide.js

jQuery(function() {

$(document).ready(function(){
$("#div1").css("display","none"); // ol id
$('#div1 :input').attr('disabled', true);
$("#div2").css("display","none"); // ol id
$('#div2 :input').attr('disabled', true);



$(".controledivs").click(function(){
if ($('input[name=radiobtngroup1]:checked').val() == "1" ) {
$("#div1").slideDown("fast"); //Slide Down Effect
$('#div1 :input').removeAttr('disabled');
} else {
$("#div1").slideUp("fast"); //Slide Up Effect
$('#div1 :input').attr('disabled', true);
}

if ($('input[name=radiobtngroup1]:checked').val() == "2" ) {
$("#div2").slideDown("fast"); //Slide Down Effect
$('#div2 :input').removeAttr('disabled');
} else {
$("#div2").slideUp("fast"); //Slide Up Effect
$('#div2 :input').attr('disabled', true);
}

});
});

});

<!------------------- html --------------------------------->


<input name="radiobtngroup1" class="controledivs" type="radio" value="1" />
<input name="radiobtngroup1" class="controledivs" type="radio" value="2" />

<div id="div1">

content

</div>

<div id="div2">

content

</div>




<!------- What can I do to use the same above jQuery for the html below ----------------->


<input name="radiobtngroup2" class="controledivs" type="radio" value="3" />
<input name="radiobtngroup2" class="controledivs" type="radio" value="4" />

<div id="div3">

content

</div>

<div id="div4">

content

</div>
View Answers









Related Pages:
Help with jQuery show hide div script - JSP-Interview Questions
Help with jQuery show hide div script  Hi guys, I have a jquery script for showing and hiding the content inside, between two divs, controlled with radiobuttons. I like to use the same jquery script for another group of divs
jQuery To Hide the Div
jQuery To Hide the Div       In this JQuery tutorial we will develop a program that Hide of a Div Steps to develop the Hide of a Div . Step 1:       Create a new file
hide and show result in jsp
hide and show result in jsp  what codes do i have to change to make... or after my while statement in search.jsp file. please help. thank you so much..., MEMBER M WHERE M.MEMBER_ID= B.MEMBER_ID"); } %> <script language="javascript
JavaScript Show Hide table
JavaScript Show Hide table...; In this section, we are going to show and hide table on clicking the button using...;h2>Show or Hide table in JavaScript</h2> <script>
Hide/show Image by click
Hide/show Image by click In this tutorial ,we will discuss about how to display image by click using jQuery. In the below example, a image and two lines...; Click here to hide the logo </font> </div> <div id
JavaScript Hide Div
JavaScript Hide Div...; In this section, we are going to hide div element on clicking the button using... the text invisible. Here is the code: <html> <h2>Hide Div
Show text by button click using jQuery
Show text by button click using jQuery In this tutorial, we will discuss about hide/show text by clicking on button. In the below example, there are two buttons : hide and show .The "hide " button is used to hide text
Hide/Show paragraph by button click
Hide/Show paragraph by button click In this tutorial, we will discuss about how to hide/show paragraph by clicking on button using jQuery. In the below... to show Paragraph</button> <p>This will Hide after clicking button<
Hide boxes by clicking on it using jQuery
Hide boxes by clicking on it using jQuery In this tutorial , we will discuss about how to hide boxes by clicking on it using jQuery. In the given below.... These hide action is due to event click. jqHideboxonclick.html  
jQuery - jQuery Tutorials and examples
;.    jQuery To Hide the Div In this JQuery tutorial we will develop a program that Hide of a Div    jQuery... will show you how to use jQuery to develop nice ajax based applications
how can i hide and show tables
how can i hide and show tables  hai, i am creating a form which the code is included below i want to hide the tables initially and after i click go i want to display the tables with result.so any help is appreciated much <
jQuery Demos
jQuery Hide/Show paragraph by button click... jQuery to validate Email Address jQuery To Hide the Div... Hide hyperlink using jQuery Hide text
Show Hide Text Javascript - Java Beginners
Show Hide Text Javascript  Please tell me how to show hide text using Java Script
JavaScript hide image
; In this section, we are going to show and hide image on clicking the button using... and Hide Image in JavaScript</h2> <script language=javascript type... JavaScript hide image
jQuery to Show Data Randomly
jQuery to Show Data Randomly      ...;head> <title>AJAX with jQuery Example</title> <script type...; <div id="wrapper"> <script type="text/javascript"
JQuery
JQuery  hi there, I am just beginner for jQuery and i want to know-what is jQuery ? How it is better than JavaScript ?   jQuery... JavaScript : Each jQuery returns itself so you can chain them together(Chaining
Hide hyperlink using jQuery
Hide hyperlink using jQuery In this tutorial, we will discuss about how to hide hyperlink after clicking it using jQuery. In the below example , a hyperlink "Click here to hide this link" is included in the web page. When we
jQuery autocomplete
with the help of jquery plugin and php/mysql . In this example when we press the name...=utf-8" /> <title>jQuery Auto Complete</title> <script...jQuery Autocomplete : Autocomplete is a common feature available in lot of web
jQuery Toggle the Div
jQuery Toggle the Div       In this JQuery tutorial we will develop a program that toggle the content...: The following code includes the jQuery JavaScript library file: <script type
Hide show HTML forms using javascript
Hide show HTML forms using javascript  How to hide a HTML form in my application using JavaScript?   HTML Code to create checkbox <...;div id="yourDiv"> ...other forms... </div> JavaScript function to hide
Show mu;tiple DIV contents in a page
Show mu;tiple DIV contents in a page  Hi All; I want to show... drop down list THE DIV content that was previously displayed will hide... CAN.... on selecting an option, it should display 1 div out of 3 div contents. 1st div tag
JavaScript hide() method
JavaScript hide() method       JavaScript provides a method hide(), so that user can hide elements whenever they require. This function may be helpful when user wants to show some
div to scrollbar - Java Beginners
div to scrollbar  hi, thanks a lot for replying but my question is some what different let me make it more clear i have div which increases in size... that division but now the question is if i resize the window which means when the div
Show text field & check input using jQuery
Show text field & check input using jQuery In this tutorial, we... input using jQuery. In the below example, aIn this tutorial, we will discuss about... jQuery. In the below example, a button is given when we click on it, 
jQuery with other libraries
;jQuery Example</title> <script type="text/javascript" src="... jQuery jquery with other Libraries      There are many JavaScript libraries to help
hide show keyboard iphone
hide show keyboard iphone  How to hide show keyboard in iPhone programmatically
hide show keyboard iphone
hide show keyboard iphone  How to hide show keyboard in iPhone programmatically
hide show keyboard iphone
hide show keyboard iphone  How to hide show keyboard in iPhone programmatically
Toggle hide/show by clicking same button
Toggle hide/show by clicking same button In this tutorial, we will discuss about how to toggle hide/show by clicking button. In the given below 2 example, there is button ,by clicking on it, the paragraph will hide/show . In first
jQuery UI effects
to use an animation with a hide, show or toggle effect , see the next section... transitions to the standard hide, show and toggle visibility functions... - As an element is being toggled between show or hide states, animate
load more with jquery
load more with jquery  i am using jquery to loadmore "posts" from my...; <script type="text/javascript" src="jquery-1.4.4.js"></script> <script type="text/javascript"> $(document).ready(function
Browser Back Button Disable/Hide/Invisible using Java Script
Browser Back Button Disable/Hide/Invisible using Java Script  Dear Sir, Please Help..., Q: How to Write Code For Browser Back Button Disable/Hide/Invisible using Java Script without Page Reload/Refreshing. anyone
jQuery tutorial for beginners
jQuery tutorial for beginners Learn jQuery with the help of our tutorial....js"></script> Step 3: Adding jQuery code to show alert message... jQuery in detail with the help of our free jQuery tutorials at http
Form validation Using Jquery Plugin
Form validation Using Jquery Plugin  Hello sir I want to implement form validation using JQuery Plug-in. My code is : <html> <style type... method="post" action=""> <div class="form-row"><span class
Hide text by clicking button
Hide text by clicking button In this tutorial, we will discuss about hide/show... : hide and show .The "hide " button is used to hide text and "show button " is used to show text. These actions are fired when "
How to hide and show some field on a radio button click
How to hide and show some field on a radio button click  This is my code part:- PAYMENT DETAILS <table cellpadding="0" cellspacing="0" align...; document.getElementById(bankname).style.display=none; } } please help me
java script text box
java script text box  hi, I created a button when i click on button(next/prev) new two textbox is created. i want to do the two textbox will show by next and prev button. when i click the next button only two textbox show
jquery
jquery  What are the Jquery similarities or difference with other java script libraries
Understanding the jQuery event handling mechanism
by : $("#butt2").hide(); After it the following script is set... are used to hide paragraph ,hide button1 , show hidden button 2 . One thing to note here that hide or show have a "slow " attribute
qunit jquery with java script
qunit jquery with java script  hi deepak How to write a javascript code and do the test by using qunit sample application and as I am new to testing how to setup the environment for java script testing? where should I run
jQuery autocomplete with jsonp
jQuery autocomplete with jsonp  I´m trying to develope an autocomplete script using jQuery, now I´m in the last step. I need to make a php page... to autocomplete)should lok like. I know the script using something call "jsonp
jQuery UI Interaction : Droppable
, it will show a alert message : Learn from experts! Attend jQuery... jQuery UI Interaction : Droppable       jQuery UI Interaction : Droppable
jQuery Load Content
of simple text file and then show on the text box. Our jQuery Load Content example... to use jQuery to Load the content from server side text file and show... with small code. jQuery is here to help us in achieving high result
Creating custom animations in jQuery
Creating custom animations in jQuery       Creating custom animations in jQuery... function of jQuery. We can do following things during animation using
help to select a value from the dropdown list
" /> <title>jQuery Auto Complete</title> <script type="text/javascript" src="../js/jquery-1.4.2.js"></script> <script...help to select a value from the dropdown list  I have a html file
jQuery Hello World
on the following link it will open a page containing jQuery library script. This file... is to include jQuery library  as: <script type="text/javascript" src...;/script> For using jQuery script ,we write it inside <script> tag
jQuery Tutorial
jQuery Tutorial jQuery is a cross browser, java Script library created by ... and the each function. JavaScript Plug-ins jQuery is java script and can... more". It handles the client side scripting of HTML. jQuery simplifies 
Insert text into database table using JSP & jQuery
. It also contain jQuery script ,to connect to another JSP page and show result...Insert text into database table using JSP & jQuery In this tutorial , the text is inserted into database table using JSP & jQuery. In the below
jQuery check username availability using JSP
jQuery check username availability using JSP In this section, you will learn to check username availability from database using JSP & jQuery...;script type="text/javascript" src="jquery-1.4.2.js"><
jQuery To callback tabs
jQuery To callback tabs       In this JQuery tutorial we will develop a program  to calling function on Tab. You will learn how to use jQuery to create callback tabs. This example

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.