Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Aug 2002
    Posts
    86
    Thanks
    2
    Thanked 1 Time in 1 Post

    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 ?

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,396
    Thanks
    12
    Thanked 569 Times in 562 Posts
    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)

  • #3
    New Coder
    Join Date
    Aug 2002
    Posts
    86
    Thanks
    2
    Thanked 1 Time in 1 Post
    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

  • #4
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,396
    Thanks
    12
    Thanked 569 Times in 562 Posts
    I wouldn't mind

  • Users who have thanked devnull69 for this post:

    waps2 (01-29-2012)

  • #5
    New Coder
    Join Date
    Aug 2002
    Posts
    86
    Thanks
    2
    Thanked 1 Time in 1 Post
    Ill send you a link in pm devnull

  • #6
    New Coder
    Join Date
    Aug 2002
    Posts
    86
    Thanks
    2
    Thanked 1 Time in 1 Post
    This is solved now

    Many thanks to devnull for helping me with this


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •