APPROVED ANSWER
replied on April 18, 2014
This is pretty straightforward. You'll need a field to capture the user's name (give it the name CSS class). Set this field's default value to one of the current user variables.
Arrange the fields that will be shown or hidden based on the user into sections and give these sections reasonable CSS class names that you can reference later (in my example, I named mine section1).
Here's the basic structure you'll use. Be sure to place everything inside your document.ready function, and then create an if/else block for each user you want to check for.
$(document).ready(function() {
if ($('.name input').val() == "Eric") {
$('.section1').hide();
} else {
$('.section1').show();
}
});
Or you could do something even simpler.
$(document).ready(function() {
$('.name input').val() == "Eric" ? $('.section1').hide() : $('.section1').show();
});
Both examples run when the document loads. If the name field will change as the user fills in the form, you'll want to adjust the code so that it runs at the appropriate time.