Click here to Skip to main content
15,892,697 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Dear All,

In a web page contain three check boxes: 1. laptops 2. mobiles 3.motorbikes

here once click laptop checkbox automatically display radiobutton of laptops prices under checkbox
and 2nd one click also come down mobiles prices lists and 3rd one also

this is i want please reply me any examples please
Posted
Updated 4-Sep-14 22:59pm
v3
Comments
Sinisa Hajnal 5-Sep-14 3:28am    
You have to explain it a bit better. Do your radio buttons come from some hidden div that "drops down" or you only mean lower on the page. Also, why don't you google it, there are plenty of jQuery / javascript examples?
member1431 5-Sep-14 5:00am    
Dear Sinisa,

In a web page contain three check boxes: 1. laptops 2. mobiles 3.motorbikes

here once click laptop checkbox automatically display radiobutton of laptops prices under checkbox
and 2nd one click also come down mobiles prices lists and 3rd one also

this is i want please reply me any examples please
Gihan Liyanage 5-Sep-14 4:43am    
Yes, You would have more information, users may not understand your requirement, its in your mind..
member1431 5-Sep-14 5:00am    
Dear Gihan,

In a web page contain three check boxes: 1. laptops 2. mobiles 3.motorbikes

here once click laptop checkbox automatically display radiobutton of laptops prices under checkbox
and 2nd one click also come down mobiles prices lists and 3rd one also

this is i want please reply me any examples please
member1431 5-Sep-14 5:37am    
Dear Gihan,
thanks for ur replying

Thanx for giving more information. Here is build example for you.

See you can get an idea for your end.

http://jsfiddle.net/jXrxW/111/[^]
 
Share this answer
 
Comments
Gihan Liyanage 5-Sep-14 5:44am    
Is this the requirement of you ?
member1431 5-Sep-14 5:54am    
yes this is my task and output is not coming
Gihan Liyanage 5-Sep-14 5:56am    
if this is the task you want, Why saying output is not coming ?? Then what you real want than this..
member1431 5-Sep-14 5:59am    
Dear Gihan,
just wait am trying now please
member1431 5-Sep-14 6:06am    
output is not coming in my visual studio please check and reply me

Design:


<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="http://code.jquery.com/jquery-1.8.2.js" type="text/javascript"></script>
<script type="text/javascript">
var lastRow = null;

$(":checkbox").click(function () {
if (lastRow != null) {
lastRow.toggle();
}
lastRow = $(this).parent().next();
lastRow.toggle();
});

</script>
<style type="text/css">

.hiddenrow
{
display:none;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div>

<table>
<tr>
<td>
<label for="colour">Colour</label>
</td>
<td>
<label for="small">Small</label>
<input type="checkbox" name="type" value="Small" />
</td>
<td class='hiddenrow'>
<input type="radio" name="colours" value="red" />
<input type="radio" name="colours" value="blue" />
<input type="radio" name="colours" value="yellow" />
</td>

</tr>
</table>

</div>
</form>

</body>
</html>
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery Show Hide Using Checkboxes</title>
<style type="text/css">
    .box{
        padding: 20px;
        display: none;
        margin-top: 20px;
        border: 1px solid #000;
    }
    .red{ background: F5F5DC	; }
    .green{ background: F5F5DC	; }
    .blue{ background: F5F5DC	; }
</style>
<script type="text/javascript" src="http://code.jquery.com/jquery.min.js"></script>
<script type="text/javascript">
    $(document).ready(function(){
        $('input[type="checkbox"]').click(function(){
            if($(this).attr("value")=="red"){
                $(".red").toggle();
            }
            if($(this).attr("value")=="green"){
                $(".green").toggle();
            }
            if($(this).attr("value")=="blue"){
                $(".blue").toggle();
            }
        });
    });
</script>
</head>
<body>
    <div>
        <label><input type="checkbox" name="colorCheckbox" value="red"> red</label>
        <label><input type="checkbox" name="colorCheckbox" value="green"> green</label>
        <label><input type="checkbox" name="colorCheckbox" value="blue"> blue</label>
    </div>
    <div class="red box">
    <input type="checkbox" name="Price1" value="1">Price 1<br>
    <input type="checkbox" name="Price2" value="2">Price 2<br>
    <input type="checkbox" name="Price3" value="3">Price 3<br>
    
    </br></br></br></div>
    <div class="green box">
    <input type="checkbox" name="Price1" value="1">Price 1<br>
    <input type="checkbox" name="Price2" value="2">Price 2<br>
    <input type="checkbox" name="Price3" value="3">Price 3<br>
    </br></br></br></div>
    <div class="blue box">
    <input type="checkbox" name="Price1" value="1">Price 1<br>
    <input type="checkbox" name="Price2" value="2">Price 2<br>
    <input type="checkbox" name="Price3" value="3">Price 3<br>
    </br></br></br></div>
</body>
</html>                                		
 
Share this answer
 
Comments
Gihan Liyanage 5-Sep-14 6:39am    
Since you have to struggle, I have posted this full page demo. Try and see.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900