PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Exclusive Radio buttons again

  1. I have a big job application and a part of that is an Equal Opportunities section;

    What I need to happen is the user can only select 1 from the 5 options, I can do this fine with jQuery.

    I have this working using the 'gform_page_loaded' filter, the only problem is the radio data isn't being sent.

    The radio groups are exclusive but no data.

    This is my function.

    add_filter('gform_pre_render_7', 'add_readonly_script');
    
    function add_readonly_script($form){
        ?>
    
        <script type="text/javascript">
    	    jQuery(document).ready(function(){
    
    		    jQuery("#input_1_1, #input_1_2").prop('readonly',true);
    
    	        jQuery(document).bind('gform_page_loaded', function(){
    	            jQuery('.equal_opp').find(':radio').attr('name', 'opt');
    
    	        });
    
    	    })
    	</script>
    
        <?php
        return $form;
    }

    Any way to do this.

    Many thanks

    neil

    Posted 9 years ago on Tuesday February 19, 2013 | Permalink
  2. Can you share the URL please to the page where this form is embedded?

    Posted 9 years ago on Tuesday February 19, 2013 | Permalink
  3. Sorry:

    http://tlc-dev.esdev.co.uk/working-at-tlc-care/latest-vacancies/application-for-employment/?id=546&title=Assistant%20Team%20Leader

    I think you answered this before.

    Thanks

    neil

    Posted 9 years ago on Tuesday February 19, 2013 | Permalink
  4. You're right, we talked about it here:
    http://www.gravityhelp.com/forums/topic/making-radio-buttons-exclusive

    Posted 9 years ago on Tuesday February 19, 2013 | Permalink
  5. Yes but changing the name attribute stops the data being sent.

    Any ideas ?

    Posted 9 years ago on Tuesday February 19, 2013 | Permalink
  6. Do you have any solutions to this, its the last thing to do.

    Cheers

    neil

    Posted 9 years ago on Thursday February 21, 2013 | Permalink
  7. Right, you can't change the attribute name.

    How about is you used one radio button group for:
    White
    Mixed,
    Asian
    Black
    Chinese

    Then used conditional logic to reveal the necessary sub-group of radio buttons. Then you would have, for example, White and possibly Irish. Would that work for you?

    Posted 9 years ago on Saturday February 23, 2013 | Permalink
  8. Also, I noticed in the source of the page you are loading an older version of jQuery:

    <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js?ver=3.5.1'></script>

    This site with WordPress 3.5.1 and Gravity Forms 1.6.12 should be using jQuery 1.8.3. That is what WordPress would enqueue if you let it. I recommend getting rid of this old version of jQuery and loading the proper 1.8.3 version.

    Posted 9 years ago on Saturday February 23, 2013 | Permalink