I see a couple of issues, some that will outright break this (the duplicate function definitions) & others that are less-than-optimal design. You don't need to load the jQuery library twice and you shouldn't define the same function twice with different contents.
Try this:
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.5.js"></script>
<script type="text/javascript">
function HideColumn(targetColumn, hideColumn) {
var columnObj = $("input[Title='" + hideColumn + "']");
$("input[Title='" + targetColumn + "']").bind('click',function() {
if($(this).is(':checked') || $(this).val() == "Pippo") {
columnObj.closest("tr").show();
}
else {
columnObj.closest("tr").hide();
}
});
}
$(document).ready(function() {
HideColumn('sino','descrizione');
HideColumn('Scelta','descrizione');
});
</script>
To also have the ability to hide certain columns on initial page load, consider the below:
UPDATE:
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.5.js"></script>
<script type="text/javascript">
function HideColumnOnLoad(hideColumn) {
$("input[Title='" + hideColumn + "']").closest("tr").hide();
}
function HideColumnOnClick(targetColumn, hideColumn) {
var columnObj = $("input[Title='" + hideColumn + "']");
$("input[Title='" + targetColumn + "']").bind('click',function() {
if($(this).is(':checked') || $(this).val() == "Pippo") {
columnObj.closest("tr").show();
}
else {
columnObj.closest("tr").hide();
}
});
}
$(document).ready(function() {
HideColumnOnLoad('descrizione');
HideColumnOnClick('sino','descrizione');
HideColumnOnClick('Scelta','descrizione');
});
</script>