SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    936
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Catch value from radio button and print?

    Hi guys,

    I'm trying to catch the value of radio button and print it to dialogue box.
    As you can see here,
    http://myonlinesmallgroup.com/warren...p/tooltip4.php

    As you can see it's not working.

    Sorry the jsfiddle version doesn't work.
    http://jsfiddle.net/xeon9/MVGKC/3/

    So what is wrong with my codes?
    Code:
    	    $(function() {
    		    $("#op1").click(function(){
    				if ($("#op1").is(":checked")) {
    					var message = document.getElementById("op1").value;
    					$("#tooltip").html(message).show();
    			    }
    			});
    			   
    		    $("#op2").click(function(){
    				if ($("#op2").is(":checked")) {
    					var message = document.getElementById("op2").value;
    					$("#tooltip").html(message).show();					
    			    }
    			});
    		    
    			//Hide tooltip When outside tooltip is click.		
    			$(document).mouseup(function (e)
    			{
    			    var container = $("#tooltip");
    			    if (!container.is(e.target) // if the target of the click isn't the container...
    			        && container.has(e.target).length === 0) // ... nor a descendant of the container
    			    {
    			        container.hide();
    			    }
    			});			
    	    });
    Thanks in advance
    Quality codes are optimized and tested...
    Click here for inspiration..

  2. #2
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Location
    Northeastern USA
    Posts
    4,615
    Mentioned
    56 Post(s)
    Tagged
    1 Thread(s)
    The jsfiddle example just needed jQuery enabled in the left panel.

    http://jsfiddle.net/MVGKC/4/

    It looks like it's working to me
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain

  3. #3
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    936
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    @Force Flow ;

    Thanks man.
    Quality codes are optimized and tested...
    Click here for inspiration..


Bookmarks

Posting Permissions

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