This forum is no longer open and is for reading/searching only.

Please use our new MachForm Community Forum instead.

MachForm Community Forums » MachForm 2

Show and Hide Field


  1. ryanmc
    Member

    Following a post I read with regards to show/hiding fields I need help.

    http://stro.ma/forms/view.php?id=3

    Please can you confirm if you are already certified with Stroma Certification * Already certifie <-- When this is clicked it should show fields.

    The javascript is showing in the view source, however it isn't working.

    if ($_GET['id'] == 3) {
    $custom_js =<<<EOT
    <script type="text/javascript" src="js/jquery/jquery-core.js"></script>
    <script>
    $(document).ready(function(){
    $('#element_4_1').click(function(){
    $('#li_10').show();
    $('#li_11').show();
    $('#li_12').show();
    $('#li_13').show();
    });
    });
    </script>
    EOT;
    }

    Any ideas?

    Posted 14 years ago #
  2. redityo

    Hi,

    It seems the problem caused by the CSS code, try to remove "display:none !important" for fields 10,11,12,13. Then update your Code to be like this

    if ($_GET['id'] == 3) {
    $custom_js =<<<EOT
    <script type="text/javascript" src="js/jquery/jquery-core.js"></script>
    <script>
    $(document).ready(function(){
    
    $('#li_10').hide();
    $('#li_11').hide();
    $('#li_12').hide();
    $('#li_13').hide();
    
    $('#element_4_1').click(function(){
    $('#li_10').show();
    $('#li_11').show();
    $('#li_12').show();
    $('#li_13').show();
    });
    });
    </script>
    EOT;
    }

    MachForm Support

    Posted 14 years ago #

RSS feed for this topic

Reply