Go Back   CodingForums.com > :: Client side development > JavaScript programming > Ajax and Design

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 01-29-2012, 12:14 PM   PM User | #1
waps2
New Coder

 
Join Date: Aug 2002
Posts: 86
Thanks: 2
Thanked 1 Time in 1 Post
waps2 is an unknown quantity at this point
Show/hide on radio button select

Hi Guys,

Im trying to get this piece of code to work which will show/hide a div on the selection of a radio button on a form. But cant get it working ?

Code:
$("input:radio[name='del_col']").click(function(){
    if ($(this).val() == 'collect')
    {
	$("#delivery_address").hide();
    }
});
Anyone know whats wrong with it ?
waps2 is offline   Reply With Quote
Old 01-29-2012, 12:36 PM   PM User | #2
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,245
Thanks: 10
Thanked 531 Times in 525 Posts
devnull69 will become famous soon enough
It should definitely work (see example: http://jsbin.com/isakep). The problem must be somewhere else

Hint: If you hover your mouse over the example page, you'll see a button "Edit in jsbin.com" on the top right corner. Use this button to view/change the full code (HTML/CSS/Javascript)
devnull69 is offline   Reply With Quote
Old 01-29-2012, 01:03 PM   PM User | #3
waps2
New Coder

 
Join Date: Aug 2002
Posts: 86
Thanks: 2
Thanked 1 Time in 1 Post
waps2 is an unknown quantity at this point
Hi devnull,

Thanks for your reply. That little editor is cool

You are right it is probably something else stopping it but I cant figure out what

If I posted a link would you mind taking a look lol
waps2 is offline   Reply With Quote
Old 01-29-2012, 01:22 PM   PM User | #4
devnull69
Senior Coder

 
Join Date: Dec 2010
Posts: 2,245
Thanks: 10
Thanked 531 Times in 525 Posts
devnull69 will become famous soon enough
I wouldn't mind
devnull69 is offline   Reply With Quote
Users who have thanked devnull69 for this post:
waps2 (01-29-2012)
Old 01-29-2012, 01:32 PM   PM User | #5
waps2
New Coder

 
Join Date: Aug 2002
Posts: 86
Thanks: 2
Thanked 1 Time in 1 Post
waps2 is an unknown quantity at this point
Ill send you a link in pm devnull
waps2 is offline   Reply With Quote
Old 01-29-2012, 02:19 PM   PM User | #6
waps2
New Coder

 
Join Date: Aug 2002
Posts: 86
Thanks: 2
Thanked 1 Time in 1 Post
waps2 is an unknown quantity at this point
This is solved now

Many thanks to devnull for helping me with this
waps2 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 02:39 AM.


Advertisement
Log in to turn off these ads.