SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: Radio style

Hybrid View

  1. #1
    SitePoint Zealot
    Join Date
    Jul 2012
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Radio style

    I would use this (http://speckyboy.com/2012/09/11/clas...ss-and-jquery/) script to apply style to my radio fields, but as I am using PHP WHILE the radio when I select one of the other results is no longer selected. How do I do this dynamically?

    Each result will have 3 radio fields. I wish only one could be selected in each result.

    jQuery:

    HTML Code:
    $(document).ready(function(){
    	$(".row a").on("click", function(e){
    		e.preventDefault();
    		
    		if($(this).hasClass("sel")) { 
    			// already selected 
    		} else {
    			$("a.sel").removeClass("sel");
    			$(this).addClass("sel");
    			
    			var rid = $(this).attr('id');
    			var value = '[value="'+rid+'"]';
    			
    			$('input:radio[name="category"]').filter(value).attr('checked', true);			
    		}
    	});
    });

  2. #2
    SitePoint Zealot
    Join Date
    Jul 2012
    Posts
    155
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    someone?


Tags for this Thread

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
  •