Q:

Laravel and hidden inputs

I want to make registration page in Laravel (default scaffolded) with little tweak. I have two radio buttons above my inputs and I'm struggling with javascript here. Guest user have two options, (user or company), if user will choose "company" button it should show different inputs than "user" has. For now I have been looking hours in google, what is best way to do it, but everything I try is doesn't work. I suck at javascript..
I have tried something like that just for testing, but looks like I'm again heading wrong way.
$(document).ready(function() {
    if (document.getElementById('user').checked) {
        document.getElementById('#name').display = 'block';
    } else if (document.getElementById('company').checked) {

    }
});

A:

Try something like this, the 2 radio's are like:
<input type="radio" name="user_type" value="1" class="user_type"> User
<input type="radio" name="user_type" value="2" class="user_type"> Company

Jquery:
$(document).ready(function() {
    $('.user_type').change(function(){
        if( $(this).val() == 1 )
        { 
            // User section code here
        }
        else
        { 
            // Company section code here
        }
    });
});

