Go Back   CodingForums.com > :: Client side development > JavaScript programming > JavaScript frameworks

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 12-18-2011, 04:22 PM   PM User | #1
sriducati
New to the CF scene

 
Join Date: Dec 2011
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
sriducati is an unknown quantity at this point
Internet Explorer very simple radio button ...simple problem

Hello webmasters,

I need to create 1 main category . and 3 sub categories usng radio button... when user clicks on "main category{radio button}" all three "sub categories{radio buttons}" should be dispalyed ...here is code for subcategories

Code:
    <input type="radio" name="sub category1" value="Times Roman"/> Times Roman

    <input type="radio" name="sub category2" value="Courier"/> Courier

    <input type="radio" name="sub category3" value="Verdana"/> Verdana
this should be embeded within "main category" which is again radio button ...only when user checks "main category radio button" all sub categories should be dispalyed ..please help me to fix this problem..expecting your response asap
sriducati is offline   Reply With Quote
Old 12-18-2011, 05:00 PM   PM User | #2
theTortoise
New to the CF scene

 
Join Date: Dec 2011
Location: Southern California
Posts: 8
Thanks: 0
Thanked 3 Times in 3 Posts
theTortoise is an unknown quantity at this point
Try using jQuery.....after your import jQuery...

PHP Code:
<script>
    $().
ready(function(){
        $(
'#cat1').click(function(){
            $(
'#subcat1').toggle();
        })
    });
</script> 
and

PHP Code:
<input type="radio" value="Times Roman" id="cat1"/> Fonts
<div id="subcat1" style="display:none;">
    <
input type="radio" name="sub category1" value="Times Roman"/> Times Roman
    
<input type="radio" name="sub category2" value="Courier"/> Courier
    
<input type="radio" name="sub category3" value="Verdana"/> Verdana
</div
I'm sure you can figure the rest out... :-)
theTortoise is offline   Reply With Quote
Old 12-19-2011, 12:11 AM   PM User | #3
sriducati
New to the CF scene

 
Join Date: Dec 2011
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
sriducati is an unknown quantity at this point
Quote:
Originally Posted by theTortoise View Post
Try using jQuery.....after your import jQuery...

PHP Code:
<script>
    $().
ready(function(){
        $(
'#cat1').click(function(){
            $(
'#subcat1').toggle();
        })
    });
</script> 
and

PHP Code:
<input type="radio" value="Times Roman" id="cat1"/> Fonts
<div id="subcat1" style="display:none;">
    <
input type="radio" name="sub category1" value="Times Roman"/> Times Roman
    
<input type="radio" name="sub category2" value="Courier"/> Courier
    
<input type="radio" name="sub category3" value="Verdana"/> Verdana
</div
I'm sure you can figure the rest out... :-)
thanks alot for your reply ...code looks everthing is correct ...but still its not working only fonts can be checked but does not show sub categories when checked ...:< ...i think we are very closer... do we have to use onclick..??any other ways????please help me....

Last edited by sriducati; 12-19-2011 at 12:20 AM..
sriducati is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:50 PM.


Advertisement
Log in to turn off these ads.