Ah ... my above code is to hide the entries when you view the entry. Anyway to hide the field in edit entries page, you should edit "view-functions.php". Let say your have these information in your form :
1. Form id : 79
2. Drop Down Field ID : 2
3. "Choose One" option located in position 2
Then try to follow these steps :
1. Go to around line 653 ~ 662, you will see these code :
$element_markup = <<<EOT
<li id="li_{$element->id}" {$error_class}>
<label class="description" for="element_{$element->id}">{$element->title} {$span_required}</label>
<div>
<select class="element select {$element->size}" id="element_{$element->id}" name="element_{$element->id}">
{$option_markup}
</select>
</div>{$guidelines} {$error_message}
</li>
EOT;
replace it with
if ($element->is_hide)
{
$hide_element = "style=display:none !important";
}
$element_markup = <<<EOT
<li {$hide_element} id="li_{$element->id}" {$error_class}>
<label class="description" for="element_{$element->id}">{$element->title} {$span_required}</label>
<div>
<select class="element select {$element->size}" id="element_{$element->id}" name="element_{$element->id}">
{$option_markup}
</select>
</div>{$guidelines} {$error_message}
</li>
EOT;
2. Go to line 2062 ~ 2064, you will see this :
if($element_data->is_private && empty($_SESSION['logged_in'])){ //don't show private element
continue;
}
add the code bellow that line, the code should be like this
if($element_data->is_private && empty($_SESSION['logged_in'])){ //don't show private element
continue;
}
//don't forget to adjust these information
if ($element_data->id == 2 &&
$form_id == 79 &&
!empty($edit_id) &&
$edit_id != 0 &&
$element_data->populated_value['element_'.$element_data->id]['default_value'] == 2) {
$element_data->is_hide = true;
}